refactor port variable and console msg
handle 404 and unsupported HTTP operations