updated samples, added json input and output