endpoints/controller — pull request #2 by iros (2014-05-01 19:17:53+00:00)
Title: adding error handling

Adding error handling to serialize & the ability to set a code on the result object.

To pass output data, set:

```javascript
res.data = yourData;
```

To set a response code:

```javascript
res.code = 400;
```

To pass an error message:
```javascript
res.data = {
errors : [
{ message : "Your message" , status : "Unauthorized" }
]
};
```