Refactoring of Rest controller. Need to update unit tests, but passes FT

AFDP-153