JavaScript error fixed.
API does't use json_encode anymore.