[SalesForce] Visualforce: cannot get forcetk.js to work: 401 Error

I'm trying to get a simple example to work with forcetk.js, where I call an apex rest service defined in the same Sandbox as the vf page below. I've tried different flavors of the URL, but the error event is always called. I've created remote sites for different versions of the Sandbox' host name, but that hasn't resolved the issue. When I specify a URL without the domain (a relative URL), I get a 302 error response. When I use the Location that Salesforce returns for the 302 response, I get a 401 cross-domain script error. I'm very new to forcetk.js, so its likely I'm doing something simple wrong. Would someone please take a look at my vf page below and tell me what am I doing wrong?

<apex:page sidebar="false">

<apex:includeScript value="{!URLFOR($Resource.jqueryui_1_11_4_custom,'/jquery-ui-1.11.4.custom/external/jquery/jquery.js')}"/>
<apex:includeScript value="{!$Resource.forcetk}"/>

<h1>ForceTK Test Page</h1>

<script type="text/javascript">
var j$ = jQuery.noConflict();
</script>

<script type="text/javascript">
    var client = new forcetk.Client('{!$Api.Session_ID}');
    client.yourAjaxNewFunction = function(mediaPlanId){
        //https://somecompany--env--c.cs7.visual.force.com/services/apexrest/mediaPlanDetail?mediaPlanId=2271&pageSize=10&_search=false&nd=1437750768584&rows=10&page=1&sidx=&sord=asc
        //var url = this.instanceUrl + '/services/apexrest/mediaPlanDetail?mediaPlanId=2271&pageSize=10&_search=false&nd=1437750768584&rows=10&page=1&sidx=&sord=asc';
        var url = '/services/apexrest/mediaPlanDetail?mediaPlanId=2271&pageSize=10&_search=false&nd=1437750768584&rows=10&page=1&sidx=&sord=asc';
        j$.ajax({
            async: this.asyncAjax,
            url: url,
            type: 'GET',
            dataType: 'json',
            contentType: 'application/json',
            error: function() { 
                //console.log(error);
                alert ( 'Error!' ); 
                },
            success: function() { alert('hello!'); },
            beforeSend: function (xhr) {
                if (this.proxyUrl !== null) {
                     xhr.setRequestHeader('SalesforceProxy-Endpoint', url);
                }
                //xhr.setRequestHeader(this.authzHeader, "OAuth " + this.sessionId);
                xhr.setRequestHeader("Authorization", 'Bearer {!$Api.Session_ID}');

                //xhr.setRequestHeader('X-User-Agent', 'salesforce-toolkit-rest-javascript/' + that.apiVersion);
                xhr.setRequestHeader('X-User-Agent', 'salesforce-toolkit-rest-javascript/' + '22');

            }
        });
    };
</script>

<form action="/">
<input type="button" onclick="client.yourAjaxNewFunction('2271');" />
</form>

</apex:page>

UPDATE

Following is the latest version of my VP page. When I click the button, my browser is reporting an error:

Uncaught TypeError: Cannot read property 'ajax' of undefined

The JavaScript statement reporting this error is in the forcetk.js code

<apex:page sidebar="false">

<apex:includeScript value="{!URLFOR($Resource.jqueryui_1_11_4_custom,'/jquery-ui-1.11.4.custom/external/jquery/jquery.js')}"/>
<apex:includeScript value="{!$Resource.forcetk}"/>

<h1>ForceTK Test Page</h1>

<script type="text/javascript">
var j$ = jQuery.noConflict();
</script>

<script type="text/javascript">
    var forceTKClient = new forcetk.Client();
    forceTKClient.setSessionToken('{!$Api.Session_ID}');

function callApex(mediaPlanId)
{
    var url = '/mediaPlanDetail' + 
        '?mediaPlanId=' + mediaPlanId + 
        '&pageSize=10' +
        '&rows=10' + 
        '&page=1' + 
        '&sidx=&' + 
        'sord=asc' +
        ''
        ;

        forceTKClient.apexrest(
            url,
            function(data, textStatus, jqXHR) {
                console.log('SUCCESS - ' + data);
            },
            function(jqXHR, textStatus, errorThrown) {
                console.log('ERROR - ' + textStatus);
            },
            'GET',
            '',
            null,
            false
         );
    };

</script>

<form action="/">
<input type="button" onclick="callApex('2271');" />
</form>

</apex:page>

Best Answer

By reviewing the the following question and answer you will find the correct syntax needed to make the appropriate forcetk.js call: https://developer.salesforce.com/forums/?id=906F00000009AtcIAE

Once that is done, please ensure that you update your jquery noconflict variable to something other than j$ to ensure that you do not have conflicts with the forcetk.js library.