Added backend functionallity to logout