Backend for logging out