(feat) write to database and retrieve user info