Connection to api