Add more unit tests for the API
Merge pull request #4812 from Snuffleupagus/more-api-unittests

Add more unit tests for the API