add func for API connection