Complete logout function on backend side