API design is really the core of programming and software engineering IMO. Finding the right balance between generality and specificity is an art. Butler Lampson recently published a new version of "Hints and Principles for Computer System Design" (https://www.dropbox.com/sh/4cex542zznbjh7b/AADM59pqAb9YBy4eeT1uw0t8a?dl=0&preview=Hints+190+full.pdf) Another relatively short read is Ousterhout's "A Philosophy of Software Design" (https://www.amazon.com/Philosophy-Software-Design-John-Ousterhout/dp/1732102201).
Thank you!