Implementding get devices rest endpoint