finally figured out JSON parsing; slowly replicating API in java