adding in a default error function for all the api ajax calls