move to the new JSON api, and pretty print