Fixed the database class so it now handles updates and deletes