Update data.rb

adding optional sorting parameters to query method.