Fix undefined method error

I just needed to remove the each loop and use the right indices for
the hash response.