add optional json output to data processing script