refactored rest services