tsg-client.rb JSON-adapted