public HttpResponseMessage GetAllSponsorships(HttpRequestMessage request) { var sponsorships = _studentApi.GetAllSponsorships(); var sponsorshipVm = SponsorshipViewModel.MultipleSponsorshipsMap(sponsorships); foreach (var sponsorship in sponsorshipVm) { sponsorship.ApplicantCount = _sponsorApi.GetStudentsApplying(sponsorship.ID).Count; sponsorship.SponsorPicturePath = _sponsorApi.GetUserInfo(sponsorship.SponsorId).ProfilePicturePath; } var response = request.CreateResponse(HttpStatusCode.OK, sponsorshipVm); return(response); }