Refactor devices api to new data standard.