cleaned up the output of arrays in the returned json object