introduced json based config
improved error code handling