Often we need to do different sets of actions based on the result of the execution of some function. Here we can discuss the API and how it can be implemented.