fix delete, clean up tests, update rest api for deletes