added templates and routing