Added authentication and updated user model