Added code for storing logs and users in the database.