How an API works