add libraries for json and fix minor bugs