unit tests for api examples