             XCTAssertEqual(response.status, .multiStatus)
             XCTAssertEqual(lamp.lightbulb.brightness.value, 50)
 
-            let json = try! JSONSerialization.jsonObject(with: response.body!)  as! [String: [[String: Any]]]
+            let json = try! JSONSerialization.jsonObject(with: response.body ?? Data())  as! [String: [[String: Any]]]
             XCTAssertEqual(json["characteristics"]![0]["status"]! as! Int, HAPStatusCodes.readOnly.rawValue)
             XCTAssertEqual(json["characteristics"]![1]["status"]! as! Int, HAPStatusCodes.success.rawValue)
 

            XCTAssertEqual(response.status, .multiStatus)
            XCTAssertEqual(lamp.lightbulb.brightness.value, 50)

            let json = try! JSONSerialization.jsonObject(with: response.body!)  as! [String: [[String: Any]]]
            XCTAssertEqual(json["characteristics"]![0]["status"]! as! Int, HAPStatusCodes.success.rawValue)
            XCTAssertEqual(json["characteristics"]![1]["status"]! as! Int, HAPStatusCodes.readOnly.rawValue)
        }

        let device = Device(setupCode: "123-44-321", storage: MemoryStorage(), accessory: lamp)
        let application = accessories(device: device)
        let response = application(MockConnection(), MockRequest.get(path: "/accessories"))
        let jsonObject = try! JSONSerialization.jsonObject(with: response.body ?? Data(), options: []) as! [String: [[String: Any]]]
        guard let accessory = jsonObject["accessories"]?.first else {
            return XCTFail("No accessory")
        }
