converting controller outout to json