Run hook_init on every page except AJAX page executions
You can check if you're processing an AJAX request or not in your hook_init() and skip your code if you need it.

function uc_cba_init(){
  if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &amp;&amp; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
    // Is an AJAX request...
  }
  else {
    // Is not an AJAX request...
  }
}


Hope it helps!