refactored the code and fixed the syntax error
added register route and template associated with it