Add JSON printing code and json pkg dependence