created funz for each route and view is rendered in index function