Added logout route and fixed logout handler