Refactor fetchDevices() in server.js