loop json on server side