moved JSON calls to individual def's, to increase speed.
Nu JSON is passed between def's