add wifi API and test code