update input (fix errors), update json export functions and improve error messages