[IMP] API: More reliable sorting for short periods
[IMP] Make CSRF error nicer
[IMP] Do not reset CSRF token on user change