docs: function (context, callback) {
  
              var self = this,
                  options = {},
                  model,
                  processor,
                  isPatch = context.request.method === "PATCH",
                  upsert = this.$resourceConfiguration.$.upsert,
                  defaults;
  
  
              flow()
                  .seq("collection", function (cb) {
                      self._findCollection(context, cb);
                  })
                  .seq(function (cb) {
                      model = this.vars.collection.createItem(self.$resourceId);
                      defaults = _.clone(model.$);
                      // check if model exists
                      if (upsert && !isPatch) {
                          cb();
                      } else {
                          model.fetch(null, cb);
                      }
                  })
                  .seq(function () {
                      if (!isPatch) {
                          model.clear();
                          model.set(defaults);
                      }
  
                      var payload = context.request.params;
  
                      processor = self.$restHandler.$restDataSource.getProcessorForModel(model);
  
                      model.set(processor.parse(model, payload || {}));
  
                      options.action = DataSource.ACTION.UPDATE;
  
                      // TODO: add hook to add session data like user id
                      if (upsert === true) {
                          options.upsert = true;
                          model.set(model.idField, model.factory.prototype.convertIdentifier(self.$resourceId));
                      }
                  })
                  .seq(function () {
                      self._generateAutoValues(model);
                  })
                  .seq(function (cb) {
                      self._validate(model, context, cb);
                  })
                  .seq(function (cb) {
                      self._beforeModelSave(model, context, cb);
                  })
                  .seq(function (cb) {
                      self._beforeModelUpdate(model, context, cb);
                  })
                  .seq(function (cb) {
                      model.validateAndSave(options, cb);
                  })
                  .seq(function (cb) {
                      self._afterModelUpdate(model, context, cb);
                  })
                  .exec(function (err, results) {
                      if (!err) {
                          // TODO: do correct invalidation
                          results.collection.invalidatePageCache();
  
                          self._fetchAllHrefsForModel(model, context);
  
                          // TODO: generate the location header
                          var body = JSON.stringify(processor.compose(model, null));
  
                          var response = context.response;
                          response.writeHead(200, "", {
                              'Content-Type': 'application/json'
                              // TODO : add updated date in head ???
  //                            'Location': context.request.urlInfo.uri
                          });
  
                          response.write(body);
                          response.end();
  
                          callback(null);
                      } else {
                          if (!(err instanceof HttpError)) {
                              var statusCode = 400;
                              if (err === DataSource.ERROR.NOT_FOUND) {
                                  statusCode = 404;
                              }
                              err = new HttpError(err, statusCode);
                          }
                          callback(err);
                      }
                  });
  
          }