public JsonResult GetAllExams() { try { List <ExamExt> exams = examService.AllExams(); return(Json(exams)); } catch (Exception ex) { _logger.LogError($"Something went wrong: {ex}"); return(Json(new { message = "Internal server error." })); } }