Created an interface to make the http requests.

With this way is easier to test.