Middleware function support

According to needs on this change you can add a middleware function to make some additional operations before the final json response.

e.g. On issue #5 was needed add an specific options on headers and this is the code:

```js
{
  //...Other options
  middleware: function(req, res) {
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Methods', 'GET, PUT, POST, DELETE, OPTIONS');
    res.header('Access-Control-Allow-Headers', 'Accept, Origin, Content-Type');
    res.header('Access-Control-Allow-Credentials', 'true');
  }
```