code: function Model(restifier, model) {
    var thiz = this;
  
    this.restifier = restifier;
    this.model = model;
  
    // Special fields
    var id;
    var restricted = this.restricted = [];
    model.schema.eachPath(function(pathName, path) {
      if (path.options.restricted) {
        restricted.push(pathName);
      }
      if (path.options.id) {
        id = pathName;
      }
    });
    this.id = id || '_id';
  
    this.modifiers = [];
    this.filters = {};
    this.transformers = [];
    this.submodels = {};
    this.middlewares = {};
    this.errMiddlewares = {};
    this.customResponse = function(json,cb) {
      return cb(null,json);
    };
  
    // Remove restricted
    this.transform(function(req, doc) {
      _.forEach(restricted, function(path) {
        delete doc[path];
      });
    });
  
    // Add id field
    this.transform(function(req, doc) {
      doc.id = doc[thiz.id];
    });
  
    // Call setupPreston static if exists
    var setup = model.schema.statics.setupPreston;
    if (setup) {
      setup.call(model.schema, this);
    }
  }
docs: Constructor.
  
  @see RestAPI#model
  
  @class
  @param {RestAPI} restifier - The RestAPI instance
  @param {mongoose.Model} model - The mongoose model that is being restified.