Add tests for device endpoint