Added /newuser code to write to MongoDB