Convert between JSON and HTML