Improved the tasks API