how to test api endpoints