Add testing and error checking for results controller