Minor cleanup and more API implementation