added database interaction and homepage