moved json handling to library
moved json handling to library