Updated class Controller with input validation and basic controller connection check