code: def _query_api(self, endpoint, **kwargs):
          
          try:
              response = requests.get(
                  '{api}/{endpoint}?{args}'.format(
                      api=self.url,
                      endpoint=endpoint,
                      args=urllib.urlencode(kwargs)),
                  headers={
                      'Authorization': 'Token {token}'.format(token=self.token)},
                  timeout=self.timeout)
  
          except requests.RequestException as err:
              raise ServiceUnavailable(err)
  
          if response.status_code == 404:
              raise NoResults()
  
          try:
              response.raise_for_status()
          except requests.HTTPError as http_err:
              raise ServerException(http_err)
  
          return response.json()
docs: Query the API.