better error handling on timeout on API call