Cleaned up API. Fixed up docs.