Made a small refactor for the DELETE operation in the rest-based api.