add tests for TokenResponse and make the class more robust