Reverse engineering APIs is fair use, not simply using APIs. Eg when Google implemented their own implementation of Java APIs, that was deemed fair use. Google only copied the interface. The courts ruled you can build a competing product that copies an interface for compatibility, just like Compaq did with IBM’s BIOS. Google absolutely would have been on the hook had they used Oracle’s implementation of the APIs.