Added try catch to database and general

Validation to ensure unique usernames are added.
The commit is in a try/catch to avoid race conditions.