Modified database query so that it uses 1 query for all of the games in the application controller