Added get_app function to Device model