I'm not sure what the preferred method is to set headers in Yii, but ideally this method should set the content type as `application/json`. Could you just do this: `header('Content-type: application/json');` before you echo the json encoded data?