Judiciary has to prevent illegal exercise of authority