Close API ports