Ajax SData Looping through record error with Client Side API Example from Sage

I am working on a customization that needs to query a view and then grab the first record returned but it's my understanding I need to use the analyse function to then call another Sdata call to get the specific record object.  I removed all of my code and just used the example from Sage on the Client Side API Example but I get the same error that I got in my customization.  Can someone please tell me what this error is caused by.  Also, if I take the http request and open in a new tab it returns data so I'm not sure why it would even be failing.  SID is put at the end but that's all I can think of.  

Are there any good examples of looping through records and grabbing the record information?  It seems like every document I find here returns 404 Not found.  

<script language='javascript'>
function nextComm() {

var crmData = {};
crmData.data = [];
crmData.execute = function() {
crm.log(crmData.data)
}
var oneWeekAgo = new Date();
oneWeekAgo.setDate(oneWeekAgo.getDate() - 7);
function analyse(crmRecord) {
if (crmRecord.isLast) {
$.each(crmRecord,function(index){
crmData.data.push(crmRecord[index]);
});
crmData.execute();
}
else {
$.each(crmRecord,function(index){
crmData.data.push(crmRecord[index]);
});
crm.sdata({
"url": crmRecord.nextLink,
"entity" : "company",
success: function (crmRecord) {
analyse(crmRecord);
}
});
}
}
crm.sdata({
"entity": "company",
count: 25,
"where": "comp_createddate gt " + crm.sdataQueryDate(oneWeekAgo),
success: function (crmRecord) {
analyse(crmRecord);
}
});



}

</script>