Added user authentication and refactored routes.