title: Having a fixed response structure with node.js and Express
body: <p>We have recently started using <code>Node.js</code> for our API server instead of <code>Java</code>. Apart from all the good things which Node.js provides, one thing I miss the most is having a proper response object for an API.</p>
  
  <p>Since Javascript being dynamically typed languages, objects can be created on the fly while returning the response. This is in contrast to Java, where I can have a class , an instance of which will be serialized in the response. I can anytime lookup this class to determine what the response of the API will be.</p>
  
  <p>Is there such a design pattern in Node.Js / Javascript. We would like our API's to have strict conformance to such templated object.</p>