fix the API connection issue