fixed routing issues for templates, still have to fix redirects