Services 3 JSON format [null] at end of all result I am using services module recently i have noticed that i am getting all responses along with [NULL] at the end. So my app dev team is unable to parse the JSON. 

What i am doing wrong ? What may be the possible causes for this ?

I think it happens with my custom module only. 
But i am sure i am using  drupal_json_output with sufficient parameters.

I have posted this question a few weeks ago, but my app dev tem fixed it. Now i am facing it again. Any help ?

/**
 * Implementation of hook_services_resources().
 */
function noteresource_services_resources() {
  return array(
    'gymcam' =&gt; array(
      'actions' =&gt; array(
        'sendmail' =&gt; array(
          'help' =&gt; 'Send gymcam to admin',
          'callback' =&gt; 'gymcam_sendemail',
          'access callback' =&gt; 'gymcam_resource_access',
          'access arguments' =&gt; array('sendmail'),
          'access arguments append' =&gt; TRUE,
          'args' =&gt; array(
            array(
              'name' =&gt; 'uid',
              'type' =&gt; 'int',
              'description' =&gt; 'The uid of the logged in user',
              'source' =&gt; 'data',
              'optional' =&gt; TRUE,
              ),               
          ),
        ),
      ),
    ),
  );
}

function gymcam_sendemail($data) {
  $data = array('status' =&gt; 'error', 'msg' =&gt; 'Mail not sent');
  drupal_json_output($data);
}
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