jQuery UI AutoComplete with wp ajax got no response
===

I am trying to use autocomplete in a custom category input. My code doesn't generate error message, it doesn't get any result either. From Firebug, I can see the ajax response always retuerns 0. Would anybody help trouble shooting my code?

HTML
----

    <div id="ctags">
    <input type='text' name="ctags-input" id='ctags-input' />
    </div>

JS
--

    jQuery(document).ready(function ($){
    	var ctag_action = 'ctag_autosuggest';
    	
    	$("#ctags-input").autocomplete({
    
    		source: function(req, add){
    
    			$.getJSON(Ctags.url+'?callback=?&action='+ctag_action, req, function(data) {
    
    				var suggestions = [];
    
    				$.each(data, function(i, val){								
    					suggestions.push(val.name);
    				});
    
    				add(suggestions);
    			});
    		}
    	});

PHP
---

    add_action('wp_ajax_ctag_autosuggest','ctag_autosuggest');
    function ctag_autosuggest() {
    	global $wpdb;
    	$taxonomy = 'ctag';
    
    	$check = term_exists('languadge',$taxonomy,0);
    	$parent = $check['term_id'];
    	
    	$s = stripslashes( $_REQUEST['term'] );
    
    	$query = $wpdb->get_results( $wpdb->prepare( 
    	"SELECT t.name 
    	FROM $wpdb->term_taxonomy AS tt 
    	INNER JOIN $wpdb->terms AS t 
    	ON tt.term_id = t.term_id 
    	WHERE tt.taxonomy = %s AND tt.parent = %d AND t.name LIKE (%s)",
    	$taxonomy, $parent, '%' . like_escape( $s ) . '%' ),
    	ARRAY_A );
    
    	echo(json_encode($code));
    	wp_die();
    }

