write README, and some minor API changes