added port config
fixed mistake in api.py