Using ActiveSupport::JSON instead of to_json