Refactored API for delete queries.