api and test for deleting objects