Updated API to pretty print JSON