Use iterencode to encode json by individual objects.