How to use CodeIgniter, jQuery, AJAX and JSON together?

When I insert data in my database table then do not return $data['ok'] = true. Why and how it solve with insert data? Then I redirect to my 'home' controller.

My controller code:

class User_registration extends CI_Controller {

public function __construct() {
    parent::__construct();
    $this->load->model('Wbd_add_info');
}

public function check_info() {

    //Information Check 
    $data = array('ok' => false, 'messages' => array());
    $this->form_validation->set_rules('cgusrnm', 'Full Name', 'trim|xss_clean|min_length[5]|required');
    $this->form_validation->set_rules('cgnnm', 'Nick Name', 'trim|xss_clean|min_length[1]|required');
    $this->form_validation->set_rules('cgeml', 'Email Address', 'trim|xss_clean|valid_email|required|is_unique[wbdusr.eml]', array('is_unique' => 'This email address already registered.'));
    $this->form_validation->set_rules('cgunm', 'User Name', 'trim|xss_clean|min_length[5]|is_unique[wbdusr.unm]|required', array('is_unique' => 'This username already exist.'));
    $this->form_validation->set_rules('cgpsd', 'Password', 'trim|xss_clean|min_length[8]|required');
    $this->form_validation->set_rules('ccgpsd', 'Confirm Password', 'trim|xss_clean|matches[cgpsd]|required', array('matches' => 'Password does not match.'));
    $this->form_validation->set_rules('cgcnm', 'Company Name', 'trim|xss_clean|required');
    $this->form_validation->set_rules('cgadr', 'User Address', 'trim|xss_clean|required');
    $this->form_validation->set_rules('cgct', 'City', 'trim|xss_clean|required');
    $this->form_validation->set_rules('cgcnt', 'Country', 'trim|xss_clean|required');
    $this->form_validation->set_rules('cgzn', 'State', 'trim|xss_clean|required');
    $this->form_validation->set_rules('cgzc', 'Zip Code', 'trim|xss_clean|min_length[1]|required');
    $this->form_validation->set_rules('cgpn', 'Phone Number', 'trim|xss_clean|required');
    $this->form_validation->set_rules('cgsn', 'Skype Name', 'trim|xss_clean|required');
    $this->form_validation->set_rules('pm', 'Payment Method', 'trim|xss_clean|required');
    $this->form_validation->set_rules('cgpeml', 'Email Address', 'trim|xss_clean|required|valid_email');

    $this->form_validation->set_error_delimiters('<p class="text-danger"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> ', '</p>');

    //Information check result
    if ($this->form_validation->run()) {
        $data['ok'] = true;
    } else {
        foreach ($_POST as $key => $value){
            $data['messages'][$key] = form_error($key);
        }
    }
    echo json_encode($data);
}

}

My model Code :

<?php

class Wbd_add_info extends CI_Model {

public function wbd_nsrt_info() {
    $nnm = $this->input->post('cgnnm');
    $cgpsd = md5($this->input->post('cgpsd'));
    $usr_eml = $this->input->post('cgeml');
    $ac = rand(100000, 999999);
    $tp = 'Affiliate';
    $wbdinfo = array(
        'fnm' => $this->input->post('cgusrnm'),
        'nnm' => $nnm,
        'eml' => $usr_eml,
        'unm' => $this->input->post('cgunm'),
        'psd' => $cgpsd,
        'cnm' => $this->input->post('cgcnm'),
        'adrs' => $this->input->post('cgadr'),
        'ct' => $this->input->post('cgct'),
        'cnt' => $this->input->post('cgcnt'),
        'zn' => $this->input->post('cgzn'),
        'zc' => $this->input->post('cgzc'),
        'phn' => $this->input->post('cgpn'),
        'sts' => $ac,
        'sn' => $this->input->post('cgsn'),
        'pm' => $this->input->post('pm'),
        'pme' => $this->input->post('cgpeml'),
        'tp' => $tp
    );

    if ($this->db->insert('wbdusr', $wbdinfo)) {
        //For send varification mail
        $this->email->set_mailtype('html');
        $this->email->from('mamun466ab@gmail.com', 'Click Giants');
        $this->email->to($usr_eml);
        $this->email->cc('rimamun.bd@gmail.com');

        $this->email->subject('Account Verification');

        $message = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>';
        $message .= '<p>Hi ' . $nnm . 'Tnank you for registration on Click Giants! Your account type "' . $tp . '". <a href="' . base_url() . 'Activation/activate_account/' . $ac . '">Click Here</a> to activate your account.</p>';
        $message .= '<p>Thanks Again</p>';
        $message .= '</body></html>';

        $this->email->message($message);
        $this->email->send();
        //Session for successfully registration message
        $sdata = array();
        $sdata['suc_msg'] = 'Thank you for registration. Please check your email address (' . $usr_eml . ') for activate your account.';
        $this->session->set_userdata($sdata);
        return TRUE;
    } else {
        return FALSE;
    }
}

}

My ajax code :

$('#form_user').submit(function(e){
e.preventDefault();

var me = $(this);

$.ajax({
    url: me.attr('action'),
    type: 'post',
    data: me.serialize(),
    datatype: 'json',
    success: function(response){
        var response = JSON.parse(response);
        if(response.ok == true){
            alert('Success.');
        }else{
            $.each(response.messages, function(key, value){
                var element = $('#' + key);
                element.closest('div.form-group')
                        .removeClass('has-error')
                        .addClass(value.length > 0 ? 'has-error' : 'has-success')
                        .find('.text-danger').remove();
                element.after(value);
            });
        }
    }
});
});