how to interact with an api