-- abstrcting out code for an HTTP call