added query support to get devices