Add edit and update functionality