update get_token method in main API