passing JSON to view (aka encoding hell)