reworked curl caller to prepare for unit test