add authentication logout + some database work