Add better exception handling for network requests