refactor the schoolservice with rest api invoking