Implemented Add/Edit functionality.