Improve debug output and show API example in README.