[RBL-04] Modifying app.js for templates and added states.