marshal the output to json