update the delete api method.