added some logging and unit tests using a mock http service