moving logic of fetching keys into controller and adding a flash notice ...

moving the logic of fetching the keys to controller and also adding a notice for updation as currently no message