Fix bug in tasks API which doesn't return the task list