added error handling for registering taken users, added tets, fixed small typo