Made several enhancements to the API.