Decorator Middleware for Node.js - serialize object to server or deserialize to client