api views: reduce code duplication - _update and _delete were almost identical