JSON manipulation and pretty printing