added completed token API and associated unit tests