Tests for app devices api methods, fixes to api to pass tests