Updated client example to build JSON tree