create restful controller for API