fix api response for token generation