fixed the delete by query and api get issue