Add task counter to client, and add a command struct