Found answer googling a bit more... on "Oliver Smith" blog.
i add this function into CI core functions by extending CI_Exceptions with this:
function show_error($heading, $message, $template = 'error_general', $status_code = 500)
{
header('Cache-Control: no-cache, must-revalidate');
header('Content-type: application/json');
header("HTTP/1.1 500 Internal Server Error");
echo json_encode(
array(
'status' => FALSE,
'error' => 'Internal Server Error',
'message' => $message
)
);
exit;
}
All credits to "Oliver Smith".