Use getApi from ClientUI\app\plugins\core\api.ts instead of creating your own instance of the API class. Pass the request from the loader args into getApi so all of the request information from the browser is passed to the API instance.The Remix session is available inside of api variable if you need it.If you need to load data for a component that isn't part of a loader (isn't a route), use a helper hook such as useLoader. To use useLoader, pass a route that has a loader into the hook call and it will internally load the data you need (load it fresh if it hasn't been loaded yet or provide the cached version if it has). It's generally a good idea to export a helper hook from the route file (such as useGeography which is exported from geography.route.tsx) to abstract away the workings of getting the data (countries and regions in this example).useLoader will return an object with a loading property and a data property.