added app.js and wrote rest api