user registration and validation through mongodb