added frontend communication in app.js