Handles stuff if changes are made to the database and deletion of events