Ensure response exists before using it