add unittest for register;
add db auto re-creation