Registering users and saves details to the database