Improve automation of api test