Updated tests to make sure the api is called correctly