added app.js file and set up peristence