refactored edit task api