Convert to hash before json

This is causing an error with Rails 4.1 and oj converting directly from a struct to json