preventing exception from being thrown on csrf error so API can function