Changed marshall/unmarshall code to json format.