public IActionResult GetSchool([FromRoute] string id) { using (var client = _client) { var response = client.GetAsync(BuildSingleRecordUrl <Org>(id)); var decoded = response.Result.Content.ReadAsStringAsync().Result; var result = JsonConvert.DeserializeObject <CrmOrg>(decoded); if (result == null || result.msk12_accounttype != OrgType.school) { return(NotFound()); } var school = new Org(result); serializer = new OneRosterSerializer("org"); school.AsJson(serializer.writer, BaseUrl()); return(JsonOk(serializer.Finish())); } }