Move task API methods to the class