Using a REST API in Python