add API tests in python