Routes middleware for user, user in models and bug fixing