acquire port in web api + validate port