Refactors AIPage.tsx to improve data handling, error resilience, and API request structure using try-catch blocks. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 6bac2659-689a-442d-ae16-f45f8d1450c7 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/9777c70b-fc38-4831-8d6b-78dfffe041b0/7ef4e00c-25b0-4098-932c-00d235018b09.jpg