How to create a simple RESTful JSON API