Fix delete api bug