Wifi connection function added to API.