render data from database to template