added some api routes to handle GET and POST requests