refactor helper methods
refactored rest ctrl
Merge pull request #132 from eugenefilimonov/refactor_rest_ctrl

Refactor rest ctrl