adden codes to convert to and from JSON data to data matrix