public static async Task <IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)] HttpRequest req,
                                                     ILogger log,
                                                     [Inject] IApprenticeshipService apprenticeshipService)
        {
            string fromQuery = req.Query["UKPRN"];
            List <Apprenticeship> apprenticeships = null;

            try
            {
                apprenticeships = (List <Apprenticeship>) await apprenticeshipService.GetApprenticeshipCollection();

                if (apprenticeships == null)
                {
                    return(new NotFoundObjectResult("Could not retrieve apprenticeships"));
                }

                var tribalProviders = (List <TribalProvider>)apprenticeshipService.ApprenticeshipsToTribalProviders(apprenticeships);
                return(new OkObjectResult(tribalProviders));
            }
            catch (Exception e)
            {
                return(new InternalServerErrorObjectResult(e));
            }
        }