Changing serialization method for json objects