code: function (callback) {
              if (_.isFunction(rep.entity.toHal)) {
                  rep.entity.toHal(rep, wrap(callback));
              } else {
                  callback(null, rep);
              }
          }
docs: Looks for a toHal(representation, next) method on the entity. If found, it is called asynchronously. The method may modify the
  representation or pass back a completely new representation by calling next(newRep)
  @param callback