var RestClient = require('rest-facade').Client;


/**
 * @class
 * Abstracts interaction with the stats endpoint.
 * @constructor
 */
var StatsManager = function (options){
  var clientOptions = {
    headers: options.headers,
    query: { repeatParams: false }
  };

  /**
   * Provides an abstraction layer for consuming the
   * [Stats endpoint]{@link https://auth0.com/docs/api/v2#!/Stats}.
   *
   * @type {external:RestClient}
   */
  this.stats = new RestClient(options.baseUrl + '/stats/:type', clientOptions);
};

/**
 * Get the daily stats.
 *
 * @method
 * @param   {Function}  [cb]  Callback function.
 * @return  {Promise}
 */
StatsManager.prototype.getDaily = function (params, cb) {
  params = params || {};
  params.type = 'daily';

  if (cb && cb instanceof Function) {
    return this.stats.get(params, cb);
  }

  return this.stats.get(params);
};

/**
 * Get a the active users count.
 *
 * @method
 * @param   {Function}  [cb]  Callback function.
 * @return  {Promise}         User retrieval promise.
 */
StatsManager.prototype.getActiveUsersCount = function (cb) {
  var options = { type: 'active-users' };

  if (cb && cb instanceof Function) {
    return this.stats.get(options, cb);
  }

  // Return a promise.
  return this.stats.get(options)
};


module.exports = StatsManager;

@@ -41,16 +41,75 @@
 Client;%0A
+var ArgumentError = require('./exceptions').ArgumentError;%0A
 %0A%0A/**%0A *
@@ -225,16 +225,426 @@
 tions)%7B%0A
+  if (options === null %7C%7C typeof options !== 'object') %7B%0A    throw new ArgumentError('Must provide manager options');%0A  %7D%0A%0A  if (options.baseUrl === null %7C%7C options.baseUrl === undefined) %7B%0A    throw new ArgumentError('Must provide a base URL for the API');%0A  %7D%0A%0A  if ('string' !== typeof options.baseUrl %7C%7C options.baseUrl.length === 0) %7B%0A    throw new ArgumentError('The provided base URL is invalid');%0A  %7D%0A%0A
   var cl

Add more strict options validation for the StatsManager class