refactoring json wrapping, fixed bug in examples