IBM Interview Question

How API works and does it replace IDOC faciility?