Earlier quoted context omitted.
That's true, but if you type and distribute a book that happens to match the latest Harry Potter, nobody - including the courts - will believe you independently came up with that exact sequence of words. Similarly, if you copy the definitions of all functions/methods/classes/etc from one API, nobody will believe you independently came up with it.
Even if the methods and functions are so basic as to not have variations?
So "add(a, b) returning the sum of the two" is probably not copyrightable by itself, but a whole namespace full of functions might be.