Updated tcp server to use promises