api: bug fix on delete task