mixed the previously written helper into the controller and tweaked some structure to get the api changes to work