inputJSON for XHRResponder and refactoring