protocol update for latest changes. added more test for token endpoint.