Reworking routes to include login and to render templates correctly