refactored some test
mocked http request in api test