code: def _raise_or_extract(self, response):
          
  
          try:
              data = response.json()
          except ValueError:
              raise JoeException("The server responded with an unexpected format ({}). Is the API url correct?". format(response.status_code))
  
          try:
              if response.ok:
                  return data['data']
              else:
                  error = data['errors'][0]
                  raise ApiError(error)
          except (KeyError, TypeError):
              raise JoeException("Unexpected data ({}). Is the API url correct?". format(response.status_code))
docs: Raises an exception if the response indicates an API error.
  
          Otherwise returns the object at the 'data' key of the API response.