added rest api functionalities in app.js