Fixed bug
added json output mode for data
Merged json branch