Help with my logic

Hello I think I found my problem. I was supposed to use setRequestHeader instead of sendRequestHeader. Also switching to console.log helped me look for the error thank you very much. Also the reason I was doing it this way was because that was how Mashape described implementing the api into javascript. Here is the link to it http://docs.mashape.com/javascript.

Thanks for all of your help!