added database layer and authentication layer (unfinished)