added JSONResponse helper; little refactoring