Creating a RESTful controller