Update Json function

Optimized json to use codeigniter output function.