Retrieve json

This was easier to use than XML, so best to merge to master.