modified update and delete in API