Database implementation updated and comments added to controllers