rename parseJSON to encodeJSON