An abstraction of the general GET method using new Promises in JS