Created more general APIService and removed redundancies