Writing an api is hard there’s no doubt, ACM have a good article with some best practice rules to follow.
It’s always hard building one and deciding who your target audience is. Obviously once you’ve built in the problem is deciding when to stop refactoring and polishing it