Updated models and route for database logic