How should you design a single-page web application where the UI communicates with a third-party API via XMLHttpRequest, ensuring that non-critical API data doesn't block UI rendering, while maintaining good performance during API errors or timeouts?