code: function(json) {
      return models.Deleted.findOne({deletedId: json._id}).then(function(doc) {
        var model = doc && getModelFromId(doc.deletedId);
        if (!model) {
          return new jsonrpc.JsonRpcError(-32001, 'Unable to restore object');
        }
        var restored = new model();
        restored.set(doc.object);
        restored.save();
        doc.remove();
        return { _id: doc._id };
      });
    }
docs: XXX revert to async version