Support IPv6 for API

Support IPv6 for API