refactor school service by using rest api