Added basic database interaction and fixed login issue