To make this code work with angularjs ajax post requests

Using boilerplate with angularjs i noticed that angular sets the csrf token in ajax post requests as a request header and not in the request body.  This change caters to that