set l to "{" & return & tab & "\"" & (item 1 of kv) & "\": \"" & (item 2 of kv) & "\","
set json to json & l
else if i > 1 and i < (count k_v) then
set l to return & tab & "\"" & (item 1 of kv) & "\": \"" & (item 2 of kv) & "\","
set json to json & l
else if i = (count k_v) then
set l to return & tab & "\"" & (item 1 of kv) & "\": \"" & (item 2 of kv) & "\"" & return & "}"