implementation of delete api