Improved error handling with streaming and API requests.