Better ajax error handling (UI doesn't just hang)