Fix ajax csrf error reporting, fix angular global methods