Refactored JSON response testing