Server side json handler: use iterators in loops.