Fix the api session problem.