Implemented backend logout functionality