some refactoring
added simple function to load devices from server