JSON serialization/deserialization offer more power

Instead of relying on json_encode which produces the end result string,
we now rely on json_serialization, because it produces an object or an
array which is more flexible than object