Changed Authentication code from Controller to Impl