public async Task <IActionResult> GetRunCount([FromQuery] int athleteId) { var response = new SingleModelResponse <double>() as ISingleModelResponse <double>; try { if (athleteId < 1) { throw new Exception("Athlete Id is missing"); } response.Model = await Task.Run(() => { double run = -1; run = _context.GetRunCount(athleteId); if (run < 0) { throw new Exception("Run does not exist"); } return(run); }); } catch (Exception ex) { response.DidError = true; response.ErrorMessage = ex.Message; } return(response.ToHttpResponse()); }