@staticmethod
def json_response(r, many=False):
    """Translates the response of the experiment API to json even if its empty.

        :param Response r: a response instance
        :param boolean many: indicates whether response is a Json list or not
        :return: a json representation of the response content
        :rtype: dict
        """
    if not r.content and not many:
        return {}
    elif not r.content and many:
        return []
    content_type = r.headers.get('Content-Type')
    if content_type == 'application/yaml':
        return {'response_yaml': True, 'content': r.content.decode()}
    return r.json()
