[refactor] tasks command: don't use task_count

because API is called twice.