json code; some remote handling