get and post request in python to call an API