Managed to connect to server at startup with new api.