Controller for main pages