Refactor parts of README.md into API.md