if department id parameter is there get the department object