Injecting the request creator to allow mocking it in unit tests

Also renamed apiUrl to apiUri