Fix dynamic reflection in REST service

First pass at refactoring REST classes to be testable and injectable