Services 3 JSON format [null] at end of all result
I dont know why do you need to convert the data to JSON format. My idea is that you just return an array. The returned data of your custom service will be based on how we call it.

function gymcam_sendemail($data) {
  $data = array('status' =&gt; 'error', 'msg' =&gt; 'Mail not sent');
  return $data;
}


If you want to use JSON for returned data, just call /gymcam/sendmail.json