try {
      var arity = layer.length;
      if (arity == 3) {
        layer(req, user, serialized);
      } else {