A user interface is visual representation of data from an application to the user; the means by which a user interacts with the computer, inputs data, view and respond to feed backs from the system.
Basically whatever the user sees while using a system can be said to be a user interface. Now an API is similar to a user interface, if not pretty much the same thing. The main difference lies in the fact that only the programmer uses an API, and not general users of the system.
An API is a set of tools, communication protocols, functions/subroutines that enables your system communicate with applications, and get services.