Turning unstructured data into a JSON while sorting it.