finish CRUD for database