Connecting to the API