Add API test. Closes #1