refactor JSON marshalling
Merge pull request #3 from measure/s-refactor

refactor JSON marshalling