I have been working on my own API (Application Programmer Interface) for the Alpha Framework for a few years now. It is a difficult thing to get right, because invariably you will write it to your taste, which may be at odds with the expected behaviour of the consumers of your API.
Josh Bloch, author of the seminal Effective Java and several of that language's core APIs gives an excellent presentation on API design principals to his colleagues at Google:
Josh believes that at some stage, all programmers will write an API whether they realise it or not, but if like me you are deliberately writing an API via a framework implementation, this video is particularly worth watching.
The only disappointment is that the sound is not synced with the video correctly :-(