Refactor deletion by id
Update API