From JSON to R6 and back