added controller logic (?) that returns the info requested to the front end, tentatively residing in the index method