hook_menu access argument returns 3 instead of data
Your delivery callback is not right. The default delivery callback is drupal_deliver_html_page($page_callback_result).

From that page:


  $page_callback_result: The result of a page callback. Can be one of:
  
  
  NULL: to indicate no content.
  An integer menu status constant: to indicate an error condition.
  A string of HTML content.
  A renderable array of content.
  


So there is no such thing as $data['error']. You are probably encoding the error code 3. 

In the default callback they catch integers as errors:

// Menu status constants are integers; page content is a string or array.
if (is_int($page_callback_result)) {
  ...
}


You might want to do the same:

function mymodule_json($data) {
  if (is_int($data)) {
    drupal_add_http_header('Status', '400 Bad Request');
  }

  echo drupal_json_output($data);
}