'Performs an API request'

def api_call(self, path):

    headers = {'X-API-Token': self.token, 'X-API-Version': self.version, 'Content-Type': 'application/json;charset=utf-8'}
    target = urlparse((self.uri + path))
    method = 'GET'
    body = ''
    try:
        (response, content) = self.conn.request(target.geturl(), method, body, headers)
    except:
        self.fail_with_error('Error    connecting    to    Rudder    server')
    try:
        data = json.loads(content)
    except ValueError as e:
        self.fail_with_error('Could    not    parse    JSON    response    from    Rudder    API', 'reading    API    response')
    return data
