decoding JSON from a reader