removed unused imports
refactor to use json lib