def get_rooms(self, lid, start=None, end=None):
        range_str = "availability"
        if start:
            start_datetime = datetime.datetime.combine(datetime.datetime.strptime(start, "%Y-%m-%d").date(), datetime.datetime.min.time())
            range_str += "=" + start
            if end and not start == end:
                range_str += "," + end
        else:
            start_datetime = None
        resp = self._request("GET", "/1.1/space/categories/{}".format(lid)).json()
        if "error" in resp:
            raise APIError(resp["error"])
        output = {"id": lid, "categories": []}
        if len(resp) < 1:
            return output
        if "error" in resp[0]:
            raise APIError(resp[0]["error"])
        if "categories" not in resp[0]:
            return output
        categories = resp[0]["categories"]
        id_to_category = {i["cid"]: i["name"] for i in categories}
        categories = ",".join([str(x["cid"]) for x in categories])
        resp = self._request("GET", "/1.1/space/category/{}".format(categories))
        for category in resp.json():
            cat_out = {"cid": category["cid"], "name": id_to_category[category["cid"]], "rooms": []}
            if cat_out["name"].endswith("Equipment"):
                continue
            items = category["items"]
            items = ",".join([str(x) for x in items])
            resp = self._request("GET", "/1.1/space/item/{}?{}".format(items, range_str))
            for room in resp.json():
                if room["id"] in ROOM_BLACKLIST:
                    continue
                if "image" in room and room["image"]:
                    if not room["image"].startswith("http"):
                        room["image"] = "https:" + room["image"]
                if "description" in room:
                    description = room["description"].replace(u'\xa0', u' ')
                    room["description"] = BeautifulSoup(description, "html.parser").text.strip()
                if "formid" in room:
                    del room["formid"]
                if start_datetime:
                    out_times = []
                    for time in room["availability"]:
                        parsed_start = datetime.datetime.strptime(time["from"][:-6], "%Y-%m-%dT%H:%M:%S")
                        if parsed_start >= start_datetime:
                            out_times.append(time)
                    room["availability"] = out_times
                cat_out["rooms"].append(room)
            if cat_out["rooms"]:
                output["categories"].append(cat_out)
        return output