starting to implement database functionality on main page