added functionality to marshall into json string