added tests for code snippets in API docs