Add and Edit functionality for CRUD