apiv2: reapplying cleanup fix of b88c2ad
apiv2: bugfix in handling doneCount (we really should move to Q instead)