Add add and update logic to database classes.