Custom Headers and success/error callbacks

Added parameters for errorCallback and customHeaders. errorCallback will
be called if the request fails (status code 400 or above). customHeaders
is an object that has a key-value system that can be inject to the request
headers before sending off the request - beneficial for things like Basic
Authorization.