Fix returning of tokens by the API