Fix several typos and the fail function
Fix the lack of a DB update policy
Fix the URL generation and the token validation