You've got full control of what you answer to the request:
Single value:
OK = just a simple string
Array:
Print JSON_ENCODE(array('Result' => 'OK'));
{"Result":"OK"} = map (or array)
List:
Print JSON_ENCODE(array(array('Result' => 'OK')));
[{"Result":"OK"}] = list with a map (or array in an array)
And you know what job you've sent, so you know what you get back, too. Even if there's an SQL-Error. Return it like this:
... or die(JSON_ENCODE(array('Error' => mysqli_error())));
and you'll get an array