working implementation of phone connection to server