good call abstracting this. in the future if we need to add a custom JSONEncoder subclass (e.g., to format datetimes, etc) it will be an easy change