Fixed major issues, changed JSON output