Re-added @q.result for json/csv

A recent commit removed the result variable from 
the index action which was used later in the 
method when rendering json/csv