public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)] HttpRequest req,
            ILogger log,
            [Inject] IApprenticeshipService apprenticeshipService)
        {
            string fromQueryId   = req.Query["id"];
            string fromQueryType = req.Query["type"];

            StandardsAndFrameworks persisted = null;

            if (string.IsNullOrWhiteSpace(fromQueryId))
            {
                return(new BadRequestObjectResult($"Empty or missing id value."));
            }

            if (!int.TryParse(fromQueryType, out int apprenticeshipType))
            {
                return(new BadRequestObjectResult($"Invalid Type value, expected a valid integer"));
            }

            if (!Guid.TryParse(fromQueryId, out Guid id))
            {
                return(new BadRequestObjectResult($"Invalid id value. Expected a non-empty valid {nameof(Guid)}"));
            }

            try
            {
                persisted = (StandardsAndFrameworks)await apprenticeshipService.GetStandardsAndFrameworksById(id, apprenticeshipType);

                if (persisted == null)
                {
                    return(new NotFoundObjectResult(id));
                }

                return(new OkObjectResult(persisted));
            }
            catch (Exception e)
            {
                return(new InternalServerErrorObjectResult(e));
            }
        }