Added json encoding test.