fix api department filtering for devices