code: function (values, model, type) {
          var deferred = Q.defer();
          var modelData = {data: model};
  
          ModelValidator.validate(values, modelData, function (err, data) {
              deferred.resolve({data: data, err: err, type: type});
          });
          return deferred.promise;
      }
docs: Validate given values using given model
  @param values
  @param model
  @param type
  @returns {*}
  @private