cleaned up API and tests