Exception handling and JSONResponse.