Add API authentication.

* Enable cache module.
* App `apps` DB table.
* Customize Kohana error handling to output error in JSON format.