Some bug fixes, in particular the refresh users code, and removing the manual refresh endpoint