Added tests to check that implementation will work, and added sendMessageToServer method