main controller and basic templates