setting up routes, getting templates in order