Added basic tests for most API functions.