api logout method