cleaned up API, added tests