updated consume_token() and added get_token()