Fix api endpoint in connection