Added device api with initial tests