formatting output as json - version 1