My goal is get a JSON like 

```json
{ 
  "meta": { 
    "error_type": "error type", 
    "code": 400, 
    "error_message": "error msg" 
  } 
}

```

In case something went wrong.
I tried to put the try catch block both in the rest controller's action and in the model but I get the whole exception stack (I mean with the layout + view)

What's the right way ?