created controller for index, logged in and users