JSON RPC
foreach changed to good practices mode