lib/responsehandler.js
function prepareResponse(status, rootUrl, queryPath, data) {
  var response = {};
  prepareMeta(response, status);
  if(rootUrl && queryPath) {
    prepareLinks(response, rootUrl, queryPath);
  }
  if(data) {
    prepareData(response, rootUrl, data);
  }
  return response;
}
function prepareResponse(status, rootUrl, queryPath, data) {
  var response = {};
  prepareMeta(response, status);
  if(rootUrl && queryPath) {
    prepareLinks(response, rootUrl, queryPath);
  }
  if(data) {
    prepareData(response, rootUrl, data);
  }
  return response;
}
function prepareResponse ( status , rootUrl , queryPath , data ) { var response = { } ; prepareMeta ( response , status ) ; if ( rootUrl && queryPath ) { prepareLinks ( response , rootUrl , queryPath ) ; } if ( data ) { prepareData ( response , rootUrl , data ) ; } return response ; }
Prepares the JSON for an API query response which is successful
@param {Number} status Integer status code
@param {String} rootUrl The root URL of the original query.
@param {String} queryPath The query path of the original query.
@param {Object} data The data to include in the response
Prepares the JSON for an API query response which is successful