create ApiController.php to support RESTful