refactor web lib, fixed undefined key in output response