setting up templates and main page