Only add cgi_data to JSON if cgi_data is present