Add better network error handling; add ability to configure connection with env vars