creating a more generic device api