Automate something when the API is called