Refactor pmda to use a REST client abstraction