return token errors as json