public IActionResult RemoveBed(string icuId, string bedId) { try { bool isDeleted = _bedRepository.RemoveBed(icuId, bedId); if (isDeleted) { return(Json("Bed Removed from ICU")); } else { return(Json("Bed could not be deleted: Bed is not free")); } } catch (Exception) { return(StatusCode(500, "unable to remove Bed")); } }