cleanup and some api tuning + fix issue when the port is not 80