Restored proper database teardown functionality
funciton to add user pubkey now takes numeric id param for user as well as map