add logout before API cases