Cleanup the API to register and call plugin functions.