add json file handler and fix issues