fix json parsing for arrays
change marshing to json