Before going to far, lets find out what you're developing on. I'm assuming its PHP. But are you doing desktop application development or web development?
If you're doing web development, then I'd lean towards getting away from the use of "UI" and "API". "UI" in a web dev environment would imply the presentation layer (client-side HTML/Flash/Java). But you toss "API" in the mix and that's more server-side with the PHP.
Now if you're thinking about how to organize your HTML and PHP code, that's, I think, a little different. This is more of a design pattern. Check out on google design patterns (toss in "web development as well"). Specifically, check out MVC (Model-View-Controller - my favorite so far). You'll probably find a LOT of Java stuff. There's actually some good ideas that are implied for Java but can be taken over to PHP with relative ease.