Added basic logic and templates for main page