implemented router and added templates