modified the main page template to render data from the database