Added user model and fixed authentication