adds navbar and some logic to the views