tweak api
examples of new json api interface
minor refactor