text);
                    });
                }
                return response.json();
            })
            .then(data => {
                console.log('Case devices raw data:', data);
                let devices = data.devices || data || [];
                
                // If devices don't have product info, fetch it separately
                if (devices.length > 0 && (!devices[0].product || !devices[0].product.name)) {
                    console.log('Devices missing product info, fetching se