Working version. Added rest service