code: function callApi(endpoint, schema) {
    if (endpoint.indexOf(API_ROOT) === -1) {
      endpoint = API_ROOT + endpoint;
    }
  
    return fetch(endpoint)
      .then(response =>
        response.json().then(json => ({ json, response}))
      ).then(({ json, response }) => {
        if (!response.ok) {
          return Promise.reject(json);
        }
  
        const camelizedJson = camelizeKeys(json);
        const nextPageUrl = getNextPageUrl(response) || undefined;
  
        return Object.assign({},
          normalize(camelizedJson, schema),
          { nextPageUrl }
        );
      });
  }
docs: Fetches an API response and normalizes the result JSON according to schema.
  This makes every API response have the same shape, regardless of how nested it was.