Refactor REST dao
Implement device registration