fixed issue with json in package file
made it to compile test  with lib from npm
refactored to make it working as previous versions broke compilation