How can my Drupal module expose custom URLs?
You need hook_menu in your .module file.


  This hook enables modules to register paths in order to define how URL requests are handled. Paths may be registered for URL handling only ...


example:

function MY_MODULE_menu() {
  $items['path/callback/%/%'] = array(
    'page callback' =&gt; 'my_callback_func',
    'page arguments' =&gt; array(2, 3),
  );

  return $items;
}

function my_callback_func($arg2, $arg3) {
  //your process here
  $data = array($arg2, $arg3);
  return drupal_json_output($data);
}


in js call this url with 2 arguments: path/callback/VAR_1/VAR_2 - VAR_1 is second argument, VAR_2 is third as defined in "'page arguments' => array(2, 3)" (path is zero argument, callback is first argument)

The $data may be returned in what you want format. In this example this is JSON.

More for hook_menu - http://api.drupalize.me/api/drupal/function/hook_menu/7