added some tests for api code