add get_tokens functions and tests