Consistent promise and event-driven API for performing HTTP/JSON requests