added db creation and functionality, logout functionality