code: function callEndPoint(sport, league, endpoint, params, paginate, data, total) {
    var deferred = Q.defer();
    options.uri = util.format("https://api.stattleship.com/%s/%s/%s", sport, league, endpoint);
    options.qs = params;
    options.qs.page = options.qs.page || 1;
  
    rp(options).then(function(response) {
      total = response.headers.total;
      data = data.concat(response.body[endpoint]);
      options.qs.page++;
  
      // Page is 0 if use did not specify specific page, if they did no need to recurse
      if(paginate && Object.keys(data).length < total) {
        callEndPoint(sport, league, endpoint, params, paginate, data, total).then(function(data) {
          deferred.resolve(data);
        });
      } else {
        deferred.resolve(data);
      }
    })
    .catch(function(r) {
        deferred.reject(e)
    });
  
    return deferred.promise;
  }
docs: Private Functions