Added basic JSON creation, fixed minor bugs and usability issues