API implementation: added json pretty-print