Converting api loader to service