tsg-client.php JSON adapted