Made connection to the server. And small fixes