Updated API to delete task