JsonGenerator code added.

currently prints json in console.