diff --git a/Android.bp b/Android.bp
index 067d089..d919409 100644
--- a/Android.bp
+++ b/Android.bp
@@ -29,4 +29,24 @@
         "bumble",
         "mobly",
     ],
+    data: [
+        "avatar/py.typed"
+    ]
+}
+
+python_test_host {
+    name: "bumble_pandora_server",
+    main: "avatar/bumble_server/__init__.py",
+    srcs: [
+        "avatar/bumble_server/*.py",
+        "avatar/bumble_device.py",
+    ],
+    libs: [
+        "bumble",
+        "pandora-python",
+    ],
+
+    test_options: {
+        unit_test: false,
+    },
 }
diff --git a/avatar/__init__.py b/avatar/__init__.py
index a2e2c12..8050261 100644
--- a/avatar/__init__.py
+++ b/avatar/__init__.py
@@ -20,23 +20,26 @@
 __version__ = "0.0.1"
 
 import functools
+import grpc
+import grpc.aio
 import importlib
 import logging
 
 from avatar import pandora_server
 from avatar.aio import asynchronous
-from avatar.pandora_client import BumblePandoraClient as BumbleDevice, PandoraClient as PandoraDevice
+from avatar.pandora_client import BumblePandoraClient as BumblePandoraDevice, PandoraClient as PandoraDevice
 from avatar.pandora_server import PandoraServer
 from mobly import base_test
-from typing import Any, Callable, Dict, Iterable, Iterator, List, Sized, Tuple, Type
+from typing import Any, Callable, Dict, Iterable, Iterator, List, Sized, Tuple, Type, TypeVar
 
 # public symbols
 __all__ = [
     'asynchronous',
     'parameterized',
+    'rpc_except',
     'PandoraDevices',
     'PandoraDevice',
-    'BumbleDevice',
+    'BumblePandoraDevice',
 ]
 
 
@@ -173,6 +176,30 @@
 
                 # we need to pass `input` here, otherwise it will be set to the value
                 # from the last iteration of `inputs`
-                setattr(owner, f"{name}{input}", decorate(input))
+                setattr(owner, f"{name}{input}".replace(' ', ''), decorate(input))
+            delattr(owner, name)
 
     return wrapper
+
+
+_T = TypeVar('_T')
+
+
+# Decorate a test function with a wrapper that catch gRPC errors
+# and call a callback if the status `code` match.
+def rpc_except(
+    excepts: Dict[grpc.StatusCode, Callable[[grpc.aio.AioRpcError], Any]],
+) -> Callable[[Callable[..., _T]], Callable[..., _T]]:
+    def wrap(func: Callable[..., _T]) -> Callable[..., _T]:
+        @functools.wraps(func)
+        def wrapper(*args: Any, **kwargs: Any) -> _T:
+            try:
+                return func(*args, **kwargs)
+            except (grpc.RpcError, grpc.aio.AioRpcError) as e:
+                if f := excepts.get(e.code(), None):  # type: ignore
+                    return f(e)  # type: ignore
+                raise e
+
+        return wrapper
+
+    return wrap
diff --git a/avatar/aio.py b/avatar/aio.py
index 5b61713..b7bb40f 100644
--- a/avatar/aio.py
+++ b/avatar/aio.py
@@ -16,25 +16,11 @@
 import functools
 import threading
 
-from typing import Any, AsyncIterator, Awaitable, Callable, Iterable, Iterator, TypeVar
+from typing import Any, Awaitable, Callable, TypeVar
 
 _T = TypeVar('_T')
 
 
-class AsyncQueue(asyncio.Queue[_T], Iterable[_T]):
-    def __aiter__(self) -> AsyncIterator[_T]:
-        return self
-
-    def __iter__(self) -> Iterator[_T]:
-        return self
-
-    async def __anext__(self) -> _T:
-        return await self.get()
-
-    def __next__(self) -> _T:
-        return run_until_complete(self.__anext__())
-
-
 # Keep running an event loop is a separate thread,
 # which is then used to:
 #   * Schedule Bumble(s) IO & gRPC server.
diff --git a/avatar/bumble_server/__init__.py b/avatar/bumble_server/__init__.py
index 839d2e7..184968f 100644
--- a/avatar/bumble_server/__init__.py
+++ b/avatar/bumble_server/__init__.py
@@ -20,97 +20,24 @@
 import grpc
 import grpc.aio
 import logging
-import os
-import sys
-import traceback
 
 from avatar.bumble_device import BumbleDevice
-from avatar.bumble_server.asha import ASHAService
 from avatar.bumble_server.host import HostService
 from avatar.bumble_server.security import SecurityService, SecurityStorageService
 from bumble.smp import PairingDelegate
-from dataclasses import dataclass
-from pandora.asha_grpc_aio import add_ASHAServicer_to_server
 from pandora.host_grpc_aio import add_HostServicer_to_server
 from pandora.security_grpc_aio import add_SecurityServicer_to_server, add_SecurityStorageServicer_to_server
-from typing import Callable, Coroutine, List, Optional
+from typing import Callable, List, Optional
 
 # Add servicers hooks.
-_SERVICERS_HOOKS: List[Callable[['Server'], None]] = []
+_SERVICERS_HOOKS: List[Callable[[BumbleDevice, grpc.aio.Server], None]] = []
 
 
-@dataclass
-class Configuration:
-    io_capability: int
-
-
-@dataclass
-class Server:
-    port: int
-    bumble: BumbleDevice
-    server: grpc.aio.Server
-    config: Configuration
-
-    async def start(self) -> None:
-        device = self.bumble.device
-
-        # add Pandora services to the gRPC server.
-        add_HostServicer_to_server(HostService(self.server, device), self.server)
-        add_SecurityServicer_to_server(SecurityService(device, self.config.io_capability), self.server)
-        add_SecurityStorageServicer_to_server(SecurityStorageService(device), self.server)
-        add_ASHAServicer_to_server(ASHAService(device), self.server)
-
-        # call hooks if any.
-        for hook in _SERVICERS_HOOKS:
-            hook(self)
-
-        try:
-            # open device.
-            await self.bumble.open()
-        except:
-            print(traceback.format_exc(), end='', file=sys.stderr)
-            os._exit(1)  # type: ignore
-
-        # Pandora require classic devices to to be discoverable & connectable.
-        if device.classic_enabled:
-            await device.set_discoverable(False)
-            await device.set_connectable(True)
-
-        # start the gRPC server.
-        await self.server.start()
-
-    async def serve(self) -> None:
-        try:
-            while True:
-                try:
-                    # serve gRPC server.
-                    await self.server.wait_for_termination()
-                except KeyboardInterrupt:
-                    return
-                finally:
-                    # close device.
-                    await self.bumble.close()
-
-                # re-initialize the gRPC server & re-start.
-                self.server = grpc.aio.server()
-                self.port = self.server.add_insecure_port(f'localhost:{self.port}')
-                await self.start()
-        except KeyboardInterrupt:
-            return
-        finally:
-            # stop server.
-            await self.server.stop(None)
-
-
-def register_servicer_hook(hook: Callable[['Server'], None]) -> None:
+def register_servicer_hook(hook: Callable[[BumbleDevice, grpc.aio.Server], None]) -> None:
     _SERVICERS_HOOKS.append(hook)
 
 
-async def create_serve_task(
-    bumble: BumbleDevice,
-    grpc_server: Optional[grpc.aio.Server] = None,
-    port: int = 0,
-) -> Coroutine[None, None, None]:
+async def serve_bumble(bumble: BumbleDevice, grpc_server: Optional[grpc.aio.Server] = None, port: int = 0) -> None:
     # initialize a gRPC server if not provided.
     server = grpc_server if grpc_server is not None else grpc.aio.server()
     port = server.add_insecure_port(f'localhost:{port}')
@@ -119,24 +46,44 @@
     io_capability_name: str = bumble.config.get('io_capability', 'no_output_no_input').upper()
     io_capability: int = getattr(PairingDelegate, io_capability_name)
 
-    # create server.
-    bumble_server = Server(port, bumble, server, Configuration(io_capability))
+    try:
+        while True:
+            # add Pandora services to the gRPC server.
+            add_HostServicer_to_server(HostService(server, bumble.device), server)
+            add_SecurityServicer_to_server(SecurityService(bumble.device, io_capability), server)
+            add_SecurityStorageServicer_to_server(SecurityStorageService(bumble.device), server)
 
-    # start bumble server & return serve task.
-    await bumble_server.start()
-    return bumble_server.serve()
+            # call hooks if any.
+            for hook in _SERVICERS_HOOKS:
+                hook(bumble, server)
+
+            # open device.
+            await bumble.open()
+            try:
+                # Pandora require classic devices to to be discoverable & connectable.
+                if bumble.device.classic_enabled:
+                    await bumble.device.set_discoverable(False)
+                    await bumble.device.set_connectable(True)
+
+                # start & serve gRPC server.
+                await server.start()
+                await server.wait_for_termination()
+            finally:
+                # close device.
+                await bumble.close()
+
+            # re-initialize the gRPC server.
+            server = grpc.aio.server()
+            server.add_insecure_port(f'localhost:{port}')
+    finally:
+        # stop server.
+        await server.stop(None)
 
 
 BUMBLE_SERVER_GRPC_PORT = 7999
 ROOTCANAL_PORT_CUTTLEFISH = 7300
 
-
-async def amain() -> None:
-    bumble = BumbleDevice({'transport': f'tcp-client:127.0.0.1:{ROOTCANAL_PORT_CUTTLEFISH}', 'classic_enabled': True})
-    serve = await create_serve_task(bumble, port=BUMBLE_SERVER_GRPC_PORT)
-    await serve
-
-
 if __name__ == '__main__':
+    bumble = BumbleDevice({'transport': f'tcp-client:127.0.0.1:{ROOTCANAL_PORT_CUTTLEFISH}', 'classic_enabled': True})
     logging.basicConfig(level=logging.DEBUG)
-    asyncio.run(amain())
+    asyncio.run(serve_bumble(bumble, port=BUMBLE_SERVER_GRPC_PORT))
diff --git a/avatar/bumble_server/asha.py b/avatar/bumble_server/asha.py
deleted file mode 100644
index ce27582..0000000
--- a/avatar/bumble_server/asha.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2022 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import grpc
-import logging
-
-from avatar.bumble_server.utils import BumbleServerLoggerAdapter
-from bumble.device import Device
-from bumble.profiles.asha_service import AshaService
-from google.protobuf.empty_pb2 import Empty
-from pandora.asha_grpc_aio import ASHAServicer
-from pandora.asha_pb2 import RegisterRequest
-from typing import Optional
-
-
-class ASHAService(ASHAServicer):
-    device: Device
-    asha_service: Optional[AshaService]
-
-    def __init__(self, device: Device) -> None:
-        self.log = BumbleServerLoggerAdapter(logging.getLogger(), {'service_name': 'Asha', 'device': device})
-        self.device = device
-        self.asha_service = None
-
-    async def Register(self, request: RegisterRequest, context: grpc.ServicerContext) -> Empty:
-        self.log.info('Register')
-        # asha service from bumble profile
-        self.asha_service = AshaService(request.capability, request.hisyncid, self.device)
-        self.device.add_service(self.asha_service)  # type: ignore[no-untyped-call]
-        return Empty()
diff --git a/avatar/bumble_server/host.py b/avatar/bumble_server/host.py
index 94ba3b9..d9d6e4a 100644
--- a/avatar/bumble_server/host.py
+++ b/avatar/bumble_server/host.py
@@ -19,7 +19,7 @@
 import logging
 import struct
 
-from avatar.bumble_server.utils import BumbleServerLoggerAdapter, address_from_request
+from . import utils
 from bumble.core import (
     BT_BR_EDR_TRANSPORT,
     BT_LE_TRANSPORT,
@@ -42,7 +42,7 @@
     HCI_REMOTE_USER_TERMINATED_CONNECTION_ERROR,
     Address,
 )
-from google.protobuf import any_pb2, empty_pb2
+from google.protobuf import any_pb2, empty_pb2  # pytype: disable=pyi-error
 from pandora.host_grpc_aio import HostServicer
 from pandora.host_pb2 import (
     NOT_CONNECTABLE,
@@ -76,7 +76,13 @@
 )
 from typing import AsyncGenerator, Dict, List, Optional, Set, Tuple, cast
 
-PRIMARY_PHY_MAP: Dict[int, PrimaryPhy] = {1: PRIMARY_1M, 3: PRIMARY_CODED}
+PRIMARY_PHY_MAP: Dict[int, PrimaryPhy] = {
+    # Default value reported by Bumble for legacy Advertising reports.
+    # FIXME(uael): `None` might be a better value, but Bumble need to change accordingly.
+    0: PRIMARY_1M,
+    1: PRIMARY_1M,
+    3: PRIMARY_CODED,
+}
 
 SECONDARY_PHY_MAP: Dict[int, SecondaryPhy] = {
     0: SECONDARY_NONE,
@@ -89,19 +95,16 @@
 class HostService(HostServicer):
     grpc_server: grpc.aio.Server
     device: Device
-    scan_queue: asyncio.Queue[Advertisement]
-    inquiry_queue: asyncio.Queue[Optional[Tuple[Address, int, AdvertisingData, int]]]
     waited_connections: Set[int]
 
     def __init__(self, grpc_server: grpc.aio.Server, device: Device) -> None:
         super().__init__()
-        self.log = BumbleServerLoggerAdapter(logging.getLogger(), {'service_name': 'Host', 'device': device})
+        self.log = utils.BumbleServerLoggerAdapter(logging.getLogger(), {'service_name': 'Host', 'device': device})
         self.grpc_server = grpc_server
         self.device = device
-        self.scan_queue = asyncio.Queue()
-        self.inquiry_queue = asyncio.Queue()
         self.waited_connections = set()
 
+    @utils.rpc
     async def FactoryReset(self, request: empty_pb2.Empty, context: grpc.ServicerContext) -> empty_pb2.Empty:
         self.log.info('FactoryReset')
 
@@ -113,24 +116,25 @@
         asyncio.create_task(self.grpc_server.stop(None))
         return empty_pb2.Empty()
 
+    @utils.rpc
     async def Reset(self, request: empty_pb2.Empty, context: grpc.ServicerContext) -> empty_pb2.Empty:
         self.log.info('Reset')
 
         # clear service.
         self.waited_connections.clear()
-        self.scan_queue = asyncio.Queue()
-        self.inquiry_queue = asyncio.Queue()
 
         # (re) power device on
         await self.device.power_on()
         return empty_pb2.Empty()
 
+    @utils.rpc
     async def ReadLocalAddress(
         self, request: empty_pb2.Empty, context: grpc.ServicerContext
     ) -> ReadLocalAddressResponse:
         self.log.info('ReadLocalAddress')
         return ReadLocalAddressResponse(address=bytes(reversed(bytes(self.device.public_address))))
 
+    @utils.rpc
     async def Connect(self, request: ConnectRequest, context: grpc.ServicerContext) -> ConnectResponse:
         # Need to reverse bytes order since Bumble Address is using MSB.
         address = Address(bytes(reversed(request.address)), address_type=Address.PUBLIC_DEVICE_ADDRESS)
@@ -152,17 +156,16 @@
         cookie = any_pb2.Any(value=connection.handle.to_bytes(4, 'big'))
         return ConnectResponse(connection=Connection(cookie=cookie))
 
+    @utils.rpc
     async def WaitConnection(
         self, request: WaitConnectionRequest, context: grpc.ServicerContext
     ) -> WaitConnectionResponse:
         if not request.address:
-            context.set_code(grpc.StatusCode.INVALID_ARGUMENT)  # type: ignore
             raise ValueError('Request address field must be set')
 
         # Need to reverse bytes order since Bumble Address is using MSB.
         address = Address(bytes(reversed(request.address)), address_type=Address.PUBLIC_DEVICE_ADDRESS)
         if address in (Address.NIL, Address.ANY):
-            context.set_code(grpc.StatusCode.INVALID_ARGUMENT)  # type: ignore
             raise ValueError('Invalid address')
 
         self.log.info(f"WaitConnection from {address}...")
@@ -183,10 +186,10 @@
         cookie = any_pb2.Any(value=connection.handle.to_bytes(4, 'big'))
         return WaitConnectionResponse(connection=Connection(cookie=cookie))
 
+    @utils.rpc
     async def ConnectLE(self, request: ConnectLERequest, context: grpc.ServicerContext) -> ConnectLEResponse:
-        address = address_from_request(request, request.WhichOneof("address"))
+        address = utils.address_from_request(request, request.WhichOneof("address"))
         if address in (Address.NIL, Address.ANY):
-            context.set_code(grpc.StatusCode.INVALID_ARGUMENT)  # type: ignore
             raise ValueError('Invalid address')
 
         self.log.info(f"ConnectLE to {address}...")
@@ -202,7 +205,6 @@
             if e.error_code == HCI_CONNECTION_ALREADY_EXISTS_ERROR:
                 self.log.warning(f"Connection already exists: {e}")
                 return ConnectLEResponse(connection_already_exists=empty_pb2.Empty())
-            context.set_code(grpc.StatusCode.ABORTED)  # type: ignore
             raise e
 
         self.log.info(f"ConnectLE to {address} done (handle={connection.handle})")
@@ -210,6 +212,7 @@
         cookie = any_pb2.Any(value=connection.handle.to_bytes(4, 'big'))
         return ConnectLEResponse(connection=Connection(cookie=cookie))
 
+    @utils.rpc
     async def Disconnect(self, request: DisconnectRequest, context: grpc.ServicerContext) -> empty_pb2.Empty:
         connection_handle = int.from_bytes(request.connection.cookie.value, 'big')
         self.log.info(f"Disconnect: {connection_handle}")
@@ -221,6 +224,7 @@
 
         return empty_pb2.Empty()
 
+    @utils.rpc
     async def WaitDisconnection(
         self, request: WaitDisconnectionRequest, context: grpc.ServicerContext
     ) -> empty_pb2.Empty:
@@ -234,29 +238,31 @@
                 disconnection_future.set_result(None)
 
             connection.on('disconnection', on_disconnection)
-            await disconnection_future
-            self.log.info("Disconnected")
+            try:
+                await disconnection_future
+                self.log.info("Disconnected")
+            finally:
+                connection.remove_listener('disconnection', on_disconnection)  # type: ignore
 
         return empty_pb2.Empty()
 
+    @utils.rpc
     async def Advertise(
         self, request: AdvertiseRequest, context: grpc.ServicerContext
     ) -> AsyncGenerator[AdvertiseResponse, None]:
-        # TODO: add support for extended advertising in Bumble
-        # TODO: add support for `request.interval`
-        # TODO: add support for `request.interval_range`
-        # TODO: add support for `request.primary_phy`
-        # TODO: add support for `request.secondary_phy`
-        assert request.legacy
-        assert not request.interval
-        assert not request.interval_range
-        assert not request.primary_phy
-        assert not request.secondary_phy
+        if not request.legacy:
+            raise NotImplementedError("TODO: add support for extended advertising in Bumble")
+        if request.interval:
+            raise NotImplementedError("TODO: add support for `request.interval`")
+        if request.interval_range:
+            raise NotImplementedError("TODO: add support for `request.interval_range`")
+        if request.primary_phy:
+            raise NotImplementedError("TODO: add support for `request.primary_phy`")
+        if request.secondary_phy:
+            raise NotImplementedError("TODO: add support for `request.secondary_phy`")
 
         if self.device.is_advertising:
-            # TODO: add support for advertising sets.
-            context.set_code(grpc.StatusCode.ABORTED)  # type: ignore
-            raise RuntimeError('Advertising sets are not yet supported, only one `Advertise` is possible at a time')
+            raise NotImplementedError('TODO: add support for advertising sets')
 
         if data := request.data:
             self.device.advertising_data = bytes(self.unpack_data_types(data))
@@ -349,19 +355,24 @@
             if request.connectable:
                 self.device.remove_listener('connection', on_connection)  # type: ignore
 
-            self.log.info('Stop advertising')
-            await self.device.abort_on('flush', self.device.stop_advertising())
+            try:
+                self.log.info('Stop advertising')
+                await self.device.abort_on('flush', self.device.stop_advertising())
+            except:
+                pass
 
+    @utils.rpc
     async def Scan(
         self, request: ScanRequest, context: grpc.ServicerContext
     ) -> AsyncGenerator[ScanningResponse, None]:
-        # TODO: add support for `request.phys`
         # TODO: modify `start_scanning` to accept floats instead of int for ms values
-        assert not request.phys
+        if request.phys:
+            raise NotImplementedError("TODO: add support for `request.phys`")
 
         self.log.info('Scan')
 
-        handler = self.device.on('advertisement', self.scan_queue.put_nowait)
+        scan_queue: asyncio.Queue[Advertisement] = asyncio.Queue()
+        handler = self.device.on('advertisement', scan_queue.put_nowait)
         await self.device.start_scanning(
             legacy=request.legacy,
             active=not request.passive,
@@ -373,7 +384,7 @@
         try:
             # TODO: add support for `direct_address` in Bumble
             # TODO: add support for `periodic_advertising_interval` in Bumble
-            while adv := await self.scan_queue.get():
+            while adv := await scan_queue.get():
                 sr = ScanningResponse(
                     legacy=adv.is_legacy,
                     connectable=adv.is_connectable,
@@ -400,25 +411,30 @@
 
         finally:
             self.device.remove_listener('advertisement', handler)  # type: ignore
-            self.scan_queue = asyncio.Queue()
-            await self.device.abort_on('flush', self.device.stop_scanning())
+            try:
+                self.log.info('Stop scanning')
+                await self.device.abort_on('flush', self.device.stop_scanning())
+            except:
+                pass
 
+    @utils.rpc
     async def Inquiry(
         self, request: empty_pb2.Empty, context: grpc.ServicerContext
     ) -> AsyncGenerator[InquiryResponse, None]:
         self.log.info('Inquiry')
 
-        complete_handler = self.device.on('inquiry_complete', lambda: self.inquiry_queue.put_nowait(None))
+        inquiry_queue: asyncio.Queue[Optional[Tuple[Address, int, AdvertisingData, int]]] = asyncio.Queue()
+        complete_handler = self.device.on('inquiry_complete', lambda: inquiry_queue.put_nowait(None))
         result_handler = self.device.on(  # type: ignore
             'inquiry_result',
-            lambda address, class_of_device, eir_data, rssi: self.inquiry_queue.put_nowait(  # type: ignore
+            lambda address, class_of_device, eir_data, rssi: inquiry_queue.put_nowait(  # type: ignore
                 (address, class_of_device, eir_data, rssi)  # type: ignore
             ),
         )
 
         await self.device.start_discovery(auto_restart=False)
         try:
-            while inquiry_result := await self.inquiry_queue.get():
+            while inquiry_result := await inquiry_queue.get():
                 (address, class_of_device, eir_data, rssi) = inquiry_result
                 # FIXME: if needed, add support for `page_scan_repetition_mode` and `clock_offset` in Bumble
                 yield InquiryResponse(
@@ -431,9 +447,13 @@
         finally:
             self.device.remove_listener('inquiry_complete', complete_handler)  # type: ignore
             self.device.remove_listener('inquiry_result', result_handler)  # type: ignore
-            self.inquiry_queue = asyncio.Queue()
-            await self.device.abort_on('flush', self.device.stop_discovery())
+            try:
+                self.log.info('Stop inquiry')
+                await self.device.abort_on('flush', self.device.stop_discovery())
+            except:
+                pass
 
+    @utils.rpc
     async def SetDiscoverabilityMode(
         self, request: SetDiscoverabilityModeRequest, context: grpc.ServicerContext
     ) -> empty_pb2.Empty:
@@ -441,6 +461,7 @@
         await self.device.set_discoverable(request.mode != NOT_DISCOVERABLE)
         return empty_pb2.Empty()
 
+    @utils.rpc
     async def SetConnectabilityMode(
         self, request: SetConnectabilityModeRequest, context: grpc.ServicerContext
     ) -> empty_pb2.Empty:
@@ -454,46 +475,59 @@
         uuids: List[str]
         datas: Dict[str, bytes]
 
+        def uuid128_from_str(uuid: str) -> bytes:
+            """Decode a 128-bit uuid encoded as XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
+            to byte format."""
+            return bytes(reversed(bytes.fromhex(uuid.replace('-', ''))))
+
+        def uuid32_from_str(uuid: str) -> bytes:
+            """Decode a 32-bit uuid encoded as XXXXXXXX to byte format."""
+            return bytes(reversed(bytes.fromhex(uuid)))
+
+        def uuid16_from_str(uuid: str) -> bytes:
+            """Decode a 16-bit uuid encoded as XXXX to byte format."""
+            return bytes(reversed(bytes.fromhex(uuid)))
+
         if uuids := dt.incomplete_service_class_uuids16:
             ad_structures.append(
                 (
                     AdvertisingData.INCOMPLETE_LIST_OF_16_BIT_SERVICE_CLASS_UUIDS,
-                    b''.join([bytes(reversed(bytes.fromhex(uuid))) for uuid in uuids]),
+                    b''.join([uuid16_from_str(uuid) for uuid in uuids]),
                 )
             )
         if uuids := dt.complete_service_class_uuids16:
             ad_structures.append(
                 (
                     AdvertisingData.COMPLETE_LIST_OF_16_BIT_SERVICE_CLASS_UUIDS,
-                    b''.join([bytes(reversed(bytes.fromhex(uuid))) for uuid in uuids]),
+                    b''.join([uuid16_from_str(uuid) for uuid in uuids]),
                 )
             )
         if uuids := dt.incomplete_service_class_uuids32:
             ad_structures.append(
                 (
                     AdvertisingData.INCOMPLETE_LIST_OF_32_BIT_SERVICE_CLASS_UUIDS,
-                    b''.join([bytes(reversed(bytes.fromhex(uuid))) for uuid in uuids]),
+                    b''.join([uuid32_from_str(uuid) for uuid in uuids]),
                 )
             )
         if uuids := dt.complete_service_class_uuids32:
             ad_structures.append(
                 (
                     AdvertisingData.COMPLETE_LIST_OF_32_BIT_SERVICE_CLASS_UUIDS,
-                    b''.join([bytes(reversed(bytes.fromhex(uuid))) for uuid in uuids]),
+                    b''.join([uuid32_from_str(uuid) for uuid in uuids]),
                 )
             )
         if uuids := dt.incomplete_service_class_uuids128:
             ad_structures.append(
                 (
                     AdvertisingData.INCOMPLETE_LIST_OF_128_BIT_SERVICE_CLASS_UUIDS,
-                    b''.join([bytes(reversed(bytes.fromhex(uuid))) for uuid in uuids]),
+                    b''.join([uuid128_from_str(uuid) for uuid in uuids]),
                 )
             )
         if uuids := dt.complete_service_class_uuids128:
             ad_structures.append(
                 (
                     AdvertisingData.COMPLETE_LIST_OF_128_BIT_SERVICE_CLASS_UUIDS,
-                    b''.join([bytes(reversed(bytes.fromhex(uuid))) for uuid in uuids]),
+                    b''.join([uuid128_from_str(uuid) for uuid in uuids]),
                 )
             )
         if dt.HasField('include_shortened_local_name'):
@@ -535,41 +569,41 @@
             ad_structures.append(
                 (
                     AdvertisingData.LIST_OF_16_BIT_SERVICE_SOLICITATION_UUIDS,
-                    b''.join([bytes(reversed(bytes.fromhex(uuid))) for uuid in uuids]),
+                    b''.join([uuid16_from_str(uuid) for uuid in uuids]),
                 )
             )
         if uuids := dt.service_solicitation_uuids32:
             ad_structures.append(
                 (
                     AdvertisingData.LIST_OF_32_BIT_SERVICE_SOLICITATION_UUIDS,
-                    b''.join([bytes(reversed(bytes.fromhex(uuid))) for uuid in uuids]),
+                    b''.join([uuid32_from_str(uuid) for uuid in uuids]),
                 )
             )
         if uuids := dt.service_solicitation_uuids128:
             ad_structures.append(
                 (
                     AdvertisingData.LIST_OF_128_BIT_SERVICE_SOLICITATION_UUIDS,
-                    b''.join([bytes(reversed(bytes.fromhex(uuid))) for uuid in uuids]),
+                    b''.join([uuid128_from_str(uuid) for uuid in uuids]),
                 )
             )
         if datas := dt.service_data_uuid16:
             ad_structures.extend(
                 [
-                    (AdvertisingData.SERVICE_DATA_16_BIT_UUID, bytes.fromhex(uuid) + data)
+                    (AdvertisingData.SERVICE_DATA_16_BIT_UUID, uuid16_from_str(uuid) + data)
                     for uuid, data in datas.items()
                 ]
             )
         if datas := dt.service_data_uuid32:
             ad_structures.extend(
                 [
-                    (AdvertisingData.SERVICE_DATA_32_BIT_UUID, bytes.fromhex(uuid) + data)
+                    (AdvertisingData.SERVICE_DATA_32_BIT_UUID, uuid32_from_str(uuid) + data)
                     for uuid, data in datas.items()
                 ]
             )
         if datas := dt.service_data_uuid128:
             ad_structures.extend(
                 [
-                    (AdvertisingData.SERVICE_DATA_128_BIT_UUID, bytes.fromhex(uuid) + data)
+                    (AdvertisingData.SERVICE_DATA_128_BIT_UUID, uuid128_from_str(uuid) + data)
                     for uuid, data in datas.items()
                 ]
             )
diff --git a/avatar/bumble_server/security.py b/avatar/bumble_server/security.py
index 8db39da..000d49f 100644
--- a/avatar/bumble_server/security.py
+++ b/avatar/bumble_server/security.py
@@ -16,15 +16,15 @@
 import grpc
 import logging
 
-from avatar.bumble_server.utils import BumbleServerLoggerAdapter, address_from_request
+from . import utils
 from bumble import hci
-from bumble.core import BT_BR_EDR_TRANSPORT, BT_LE_TRANSPORT, ProtocolError
+from bumble.core import BT_BR_EDR_TRANSPORT, BT_LE_TRANSPORT, BT_PERIPHERAL_ROLE, ProtocolError
 from bumble.device import Connection as BumbleConnection, Device
 from bumble.hci import HCI_Error
 from bumble.smp import PairingConfig, PairingDelegate as BasePairingDelegate
 from contextlib import suppress
-from google.protobuf import any_pb2, empty_pb2, wrappers_pb2
-from google.protobuf.wrappers_pb2 import BoolValue
+from google.protobuf import any_pb2, empty_pb2, wrappers_pb2  # pytype: disable=pyi-error
+from google.protobuf.wrappers_pb2 import BoolValue  # pytype: disable=pyi-error
 from pandora.host_pb2 import Connection
 from pandora.security_grpc_aio import SecurityServicer, SecurityStorageServicer
 from pandora.security_pb2 import (
@@ -60,7 +60,7 @@
         local_initiator_key_distribution: int = BasePairingDelegate.DEFAULT_KEY_DISTRIBUTION,
         local_responder_key_distribution: int = BasePairingDelegate.DEFAULT_KEY_DISTRIBUTION,
     ) -> None:
-        self.log = BumbleServerLoggerAdapter(
+        self.log = utils.BumbleServerLoggerAdapter(
             logging.getLogger(), {'service_name': 'Security', 'device': connection.device}
         )
         self.connection = connection
@@ -85,46 +85,67 @@
     async def confirm(self) -> bool:
         self.log.info(f"Pairing event: `just_works` (io_capability: {self.io_capability})")
 
-        if not self.service.event_queue or not self.service.event_answer:
+        if self.service.event_queue is None or self.service.event_answer is None:
             return True
 
         event = self.add_origin(PairingEvent(just_works=empty_pb2.Empty()))
         self.service.event_queue.put_nowait(event)
-        answer = await anext(self.service.event_answer)
+        answer = await anext(self.service.event_answer)  # pytype: disable=name-error
         assert answer.event == event
-        assert answer.confirm
+        assert answer.answer_variant() == 'confirm' and answer.confirm is not None
         return answer.confirm
 
     async def compare_numbers(self, number: int, digits: int = 6) -> bool:
         self.log.info(f"Pairing event: `numeric_comparison` (io_capability: {self.io_capability})")
 
-        if not self.service.event_queue or not self.service.event_answer:
+        if self.service.event_queue is None or self.service.event_answer is None:
             raise RuntimeError('security: unhandled number comparison request')
 
         event = self.add_origin(PairingEvent(numeric_comparison=number))
         self.service.event_queue.put_nowait(event)
-        answer = await anext(self.service.event_answer)
+        answer = await anext(self.service.event_answer)  # pytype: disable=name-error
         assert answer.event == event
-        assert answer.confirm
+        assert answer.answer_variant() == 'confirm' and answer.confirm is not None
         return answer.confirm
 
-    async def get_number(self) -> int:
+    async def get_number(self) -> Optional[int]:
         self.log.info(f"Pairing event: `passkey_entry_request` (io_capability: {self.io_capability})")
 
-        if not self.service.event_queue or not self.service.event_answer:
+        if self.service.event_queue is None or self.service.event_answer is None:
             raise RuntimeError('security: unhandled number request')
 
         event = self.add_origin(PairingEvent(passkey_entry_request=empty_pb2.Empty()))
         self.service.event_queue.put_nowait(event)
-        answer = await anext(self.service.event_answer)
+        answer = await anext(self.service.event_answer)  # pytype: disable=name-error
         assert answer.event == event
-        assert answer.passkey is not None
+        assert answer.answer_variant() == 'passkey'
         return answer.passkey
 
+    async def get_string(self, max_length: int) -> Optional[str]:
+        self.log.info(f"Pairing event: `pin_code_request` (io_capability: {self.io_capability})")
+
+        if self.service.event_queue is None or self.service.event_answer is None:
+            raise RuntimeError('security: unhandled pin_code request')
+
+        event = self.add_origin(PairingEvent(pin_code_request=empty_pb2.Empty()))
+        self.service.event_queue.put_nowait(event)
+        answer = await anext(self.service.event_answer)  # pytype: disable=name-error
+        assert answer.event == event
+        assert answer.answer_variant() == 'pin'
+
+        if answer.pin is None:
+            return None
+
+        pin = answer.pin.decode('utf-8')
+        if not pin or len(pin) > max_length:
+            raise ValueError(f'Pin must be utf-8 encoded up to {max_length} bytes')
+
+        return pin
+
     async def display_number(self, number: int, digits: int = 6) -> None:
         self.log.info(f"Pairing event: `passkey_entry_notification` (io_capability: {self.io_capability})")
 
-        if not self.service.event_queue:
+        if self.service.event_queue is None:
             raise RuntimeError('security: unhandled number display request')
 
         event = self.add_origin(PairingEvent(passkey_entry_notification=number))
@@ -157,7 +178,7 @@
 
 class SecurityService(SecurityServicer):
     def __init__(self, device: Device, io_capability: int) -> None:
-        self.log = BumbleServerLoggerAdapter(logging.getLogger(), {'service_name': 'Security', 'device': device})
+        self.log = utils.BumbleServerLoggerAdapter(logging.getLogger(), {'service_name': 'Security', 'device': device})
         self.event_queue: Optional[asyncio.Queue[PairingEvent]] = None
         self.event_answer: Optional[AsyncIterator[PairingEventAnswer]] = None
         self.device = device
@@ -175,12 +196,13 @@
         setattr(device, 'io_capability', io_capability)
         self.device.pairing_config_factory = pairing_config_factory
 
+    @utils.rpc
     async def OnPairing(
         self, request: AsyncIterator[PairingEventAnswer], context: grpc.ServicerContext
     ) -> AsyncGenerator[PairingEvent, None]:
         self.log.info('OnPairing')
 
-        if self.event_queue:
+        if self.event_queue is not None:
             raise RuntimeError('already streaming pairing events')
 
         if len(self.device.connections):
@@ -197,6 +219,7 @@
             self.event_queue = None
             self.event_answer = None
 
+    @utils.rpc
     async def Secure(self, request: SecureRequest, context: grpc.ServicerContext) -> SecureResponse:
         connection_handle = int.from_bytes(request.connection.cookie.value, 'big')
         self.log.info(f"Secure: {connection_handle}")
@@ -216,7 +239,18 @@
         if self.need_pairing(connection, level):
             try:
                 self.log.info('Pair...')
-                await connection.pair()
+
+                if connection.transport == BT_LE_TRANSPORT and connection.role == BT_PERIPHERAL_ROLE:
+                    wait_for_security: asyncio.Future[bool] = asyncio.get_running_loop().create_future()
+                    connection.on("pairing", lambda *_: wait_for_security.set_result(True))  # type: ignore
+                    connection.on("pairing_failure", wait_for_security.set_exception)
+
+                    connection.request_pairing()
+
+                    await wait_for_security
+                else:
+                    await connection.pair()
+
                 self.log.info('Paired')
             except asyncio.CancelledError:
                 self.log.warning(f"Connection died during encryption")
@@ -256,6 +290,7 @@
             return SecureResponse(success=empty_pb2.Empty())
         return SecureResponse(not_reached=empty_pb2.Empty())
 
+    @utils.rpc
     async def WaitSecurity(self, request: WaitSecurityRequest, context: grpc.ServicerContext) -> WaitSecurityResponse:
         connection_handle = int.from_bytes(request.connection.cookie.value, 'big')
         self.log.info(f"WaitSecurity: {connection_handle}")
@@ -382,6 +417,7 @@
         return level >= LEVEL2 and not connection.authenticated
 
     def need_encryption(self, connection: BumbleConnection, level: int) -> bool:
+        # TODO(abel): need to support MITM
         if connection.transport == BT_LE_TRANSPORT:
             return level == LE_LEVEL2 and not connection.encryption
         return level >= LEVEL2 and not connection.encryption
@@ -389,13 +425,14 @@
 
 class SecurityStorageService(SecurityStorageServicer):
     def __init__(self, device: Device) -> None:
-        self.log = BumbleServerLoggerAdapter(
+        self.log = utils.BumbleServerLoggerAdapter(
             logging.getLogger(), {'service_name': 'SecurityStorage', 'device': device}
         )
         self.device = device
 
+    @utils.rpc
     async def IsBonded(self, request: IsBondedRequest, context: grpc.ServicerContext) -> wrappers_pb2.BoolValue:
-        address = address_from_request(request, request.WhichOneof("address"))
+        address = utils.address_from_request(request, request.WhichOneof("address"))
         self.log.info(f"IsBonded: {address}")
 
         if self.device.keystore is not None:
@@ -405,8 +442,9 @@
 
         return BoolValue(value=is_bonded)
 
+    @utils.rpc
     async def DeleteBond(self, request: DeleteBondRequest, context: grpc.ServicerContext) -> empty_pb2.Empty:
-        address = address_from_request(request, request.WhichOneof("address"))
+        address = utils.address_from_request(request, request.WhichOneof("address"))
         self.log.info(f"DeleteBond: {address}")
 
         if self.device.keystore is not None:
diff --git a/avatar/bumble_server/utils.py b/avatar/bumble_server/utils.py
index f841da0..fc47d09 100644
--- a/avatar/bumble_server/utils.py
+++ b/avatar/bumble_server/utils.py
@@ -12,12 +12,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import contextlib
+import functools
+import grpc
+import inspect
 import logging
 
 from bumble.device import Device
 from bumble.hci import Address
-from google.protobuf.message import Message
-from typing import Any, MutableMapping, Optional, Tuple
+from google.protobuf.message import Message  # pytype: disable=pyi-error
+from typing import Any, Generator, MutableMapping, Optional, Tuple
 
 ADDRESS_TYPES: dict[str, int] = {
     "public": Address.PUBLIC_DEVICE_ADDRESS,
@@ -42,6 +46,57 @@
         assert isinstance(service_name, str)
         device = self.extra['device']
         assert isinstance(device, Device)
-        addr_bytes = bytes(reversed(bytes(device.public_address)))
+        addr_bytes = bytes(reversed(bytes(device.public_address)))  # pytype: disable=attribute-error
         addr = ':'.join([f'{x:02X}' for x in addr_bytes[4:]])
         return (f'[bumble.{service_name}:{addr}] {msg}', kwargs)
+
+
+@contextlib.contextmanager
+def exception_to_rpc_error(context: grpc.ServicerContext) -> Generator[None, None, None]:
+    try:
+        yield None
+    except NotImplementedError as e:
+        context.set_code(grpc.StatusCode.UNIMPLEMENTED)  # type: ignore
+        context.set_details(str(e))  # type: ignore
+    except ValueError as e:
+        context.set_code(grpc.StatusCode.INVALID_ARGUMENT)  # type: ignore
+        context.set_details(str(e))  # type: ignore
+    except RuntimeError as e:
+        context.set_code(grpc.StatusCode.ABORTED)  # type: ignore
+        context.set_details(str(e))  # type: ignore
+
+
+# Decorate an RPC servicer method with a wrapper that transform exceptions to gRPC errors.
+def rpc(func: Any) -> Any:
+    @functools.wraps(func)
+    async def asyncgen_wrapper(self: Any, request: Any, context: grpc.ServicerContext) -> Any:
+        with exception_to_rpc_error(context):
+            async for v in func(self, request, context):
+                yield v
+
+    @functools.wraps(func)
+    async def async_wrapper(self: Any, request: Any, context: grpc.ServicerContext) -> Any:
+        with exception_to_rpc_error(context):
+            return await func(self, request, context)
+
+    @functools.wraps(func)
+    def gen_wrapper(self: Any, request: Any, context: grpc.ServicerContext) -> Any:
+        with exception_to_rpc_error(context):
+            for v in func(self, request, context):
+                yield v
+
+    @functools.wraps(func)
+    def wrapper(self: Any, request: Any, context: grpc.ServicerContext) -> Any:
+        with exception_to_rpc_error(context):
+            return func(self, request, context)
+
+    if inspect.isasyncgenfunction(func):
+        return asyncgen_wrapper
+
+    if inspect.iscoroutinefunction(func):
+        return async_wrapper
+
+    if inspect.isgenerator(func):
+        return gen_wrapper
+
+    return wrapper
diff --git a/avatar/controllers/__init__.py b/avatar/controllers/__init__.py
new file mode 100644
index 0000000..543e742
--- /dev/null
+++ b/avatar/controllers/__init__.py
@@ -0,0 +1,17 @@
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Avatar Mobly controllers."""
+
+__version__ = "0.0.1"
diff --git a/avatar/pandora_client.py b/avatar/pandora_client.py
index c576883..548e6d1 100644
--- a/avatar/pandora_client.py
+++ b/avatar/pandora_client.py
@@ -15,6 +15,7 @@
 
 """Pandora client interface for Avatar tests."""
 
+import asyncio
 import avatar.aio
 import bumble
 import bumble.device
@@ -25,8 +26,8 @@
 from avatar.bumble_device import BumbleDevice
 from bumble.hci import Address as BumbleAddress
 from dataclasses import dataclass
-from pandora import asha_grpc, asha_grpc_aio, host_grpc, host_grpc_aio, security_grpc, security_grpc_aio
-from typing import Any, MutableMapping, Optional, Tuple, Union
+from pandora import host_grpc, host_grpc_aio, security_grpc, security_grpc_aio
+from typing import Any, Dict, MutableMapping, Optional, Tuple, Union
 
 
 class Address(bytes):
@@ -55,9 +56,9 @@
     # public fields
     grpc_target: str  # Server address for the gRPC channel.
     log: 'PandoraClientLoggerAdapter'  # Logger adapter.
-    channel: grpc.Channel  # Synchronous gRPC channel.
 
     # private fields
+    _channel: grpc.Channel  # Synchronous gRPC channel.
     _address: Address  # Bluetooth device address
     _aio: Optional['PandoraClient.Aio']  # Asynchronous gRPC channel.
 
@@ -71,13 +72,13 @@
         """
         self.grpc_target = grpc_target
         self.log = PandoraClientLoggerAdapter(logging.getLogger(), {'client': self, 'client_name': name})
-        self.channel = grpc.insecure_channel(grpc_target)  # type: ignore
+        self._channel = grpc.insecure_channel(grpc_target)  # type: ignore
         self._address = Address(b'\x00\x00\x00\x00\x00\x00')
         self._aio = None
 
     def close(self) -> None:
         """Closes the gRPC channels."""
-        self.channel.close()
+        self._channel.close()
         if self._aio:
             avatar.aio.run_until_complete(self._aio.channel.close())
 
@@ -93,19 +94,38 @@
 
     async def reset(self) -> None:
         """Factory reset the device & read it's BD address."""
-        await self.aio.host.FactoryReset()
-        # Factory reset stopped the server, close the client too.
-        assert self._aio
-        await self._aio.channel.close()
-        self._aio = None
-        # Try to connect to the new server 3 times before failing.
-        for _ in range(0, 3):
+        attempts, max_attempts = 1, 3
+        while True:
             try:
-                self._address = Address((await self.aio.host.ReadLocalAddress(wait_for_ready=True)).address)
+                await self.aio.host.FactoryReset(wait_for_ready=True, timeout=15.0)
+
+                # Factory reset stopped the server, close the client too.
+                assert self._aio
+                await self._aio.channel.close()
+                self._aio = None
+
+                # This call might fail if the server is unavailable.
+                self._address = Address(
+                    (await self.aio.host.ReadLocalAddress(wait_for_ready=True, timeout=15.0)).address
+                )
                 return
-            except grpc.RpcError as e:
-                assert e.code() == grpc.StatusCode.UNAVAILABLE  # type: ignore
-        raise RuntimeError('unable to establish a new connection after a `FactoryReset`')
+            except grpc.aio.AioRpcError as e:
+                if e.code() in (grpc.StatusCode.UNAVAILABLE, grpc.StatusCode.DEADLINE_EXCEEDED):
+                    if attempts <= max_attempts:
+                        self.log.debug(f'Server unavailable, retry [{attempts}/{max_attempts}].')
+                        attempts += 1
+                        continue
+                    self.log.exception(f'Server still unavailable after {attempts} attempts, abort.')
+                raise e
+
+    @property
+    def channel(self) -> grpc.Channel:
+        """Returns the synchronous gRPC channel."""
+        try:
+            _ = asyncio.get_running_loop()
+        except:
+            return self._channel
+        raise RuntimeError('Trying to use the synchronous gRPC channel from asynchronous code.')
 
     # Pandora interfaces
 
@@ -124,11 +144,6 @@
         """Returns the Pandora SecurityStorage gRPC interface."""
         return security_grpc.SecurityStorage(self.channel)
 
-    @property
-    def asha(self) -> asha_grpc.ASHA:
-        """Returns the Pandora ASHA gRPC interface."""
-        return asha_grpc.ASHA(self.channel)
-
     @dataclass
     class Aio:
         channel: grpc.aio.Channel
@@ -148,11 +163,6 @@
             """Returns the Pandora SecurityStorage gRPC interface."""
             return security_grpc_aio.SecurityStorage(self.channel)
 
-        @property
-        def asha(self) -> asha_grpc_aio.ASHA:
-            """Returns the Pandora ASHA gRPC interface."""
-            return asha_grpc_aio.ASHA(self.channel)
-
     @property
     def aio(self) -> 'PandoraClient.Aio':
         if not self._aio:
@@ -182,6 +192,10 @@
         self._bumble = bumble
 
     @property
+    def config(self) -> Dict[str, Any]:
+        return self._bumble.config
+
+    @property
     def device(self) -> bumble.device.Device:
         return self._bumble.device
 
diff --git a/avatar/pandora_server.py b/avatar/pandora_server.py
index 0e00fcf..ceb57ed 100644
--- a/avatar/pandora_server.py
+++ b/avatar/pandora_server.py
@@ -20,11 +20,10 @@
 import grpc
 import grpc.aio
 import threading
-import time
 import types
 
 from avatar.bumble_device import BumbleDevice
-from avatar.bumble_server import create_serve_task
+from avatar.bumble_server import serve_bumble
 from avatar.controllers import bumble_device, pandora_device
 from avatar.pandora_client import BumblePandoraClient, PandoraClient
 from contextlib import suppress
@@ -65,7 +64,7 @@
 
 
 class BumblePandoraServer(PandoraServer[BumbleDevice]):
-    """Manages the Pandora gRPC server on an BumbleDevice."""
+    """Manages the Pandora gRPC server on a BumbleDevice."""
 
     MOBLY_CONTROLLER_MODULE = bumble_device
 
@@ -82,15 +81,7 @@
         server = grpc.aio.server()
         port = server.add_insecure_port(f'localhost:{0}')
 
-        self._task = avatar.aio.loop.create_task(
-            avatar.aio.run_until_complete(
-                create_serve_task(
-                    self.device,
-                    grpc_server=server,
-                    port=port,
-                )
-            )
-        )
+        self._task = avatar.aio.loop.create_task(serve_bumble(self.device, grpc_server=server, port=port))
 
         return BumblePandoraClient(f'localhost:{port}', self.device)
 
@@ -99,9 +90,10 @@
 
         async def server_stop() -> None:
             assert self._task is not None
-            self._task.cancel()
-            with suppress(asyncio.CancelledError):
-                await self._task
+            if not self._task.done():
+                self._task.cancel()
+                with suppress(asyncio.CancelledError):
+                    await self._task
             self._task = None
 
         avatar.aio.run_until_complete(server_stop())
@@ -133,10 +125,7 @@
         self._instrumentation.start()
         self.device.adb.forward([f'tcp:{self._port}', f'tcp:{ANDROID_SERVER_GRPC_PORT}'])  # type: ignore
 
-        # wait a few seconds for the Android gRPC server to be started.
-        time.sleep(3)
-
-        return PandoraClient(f'localhost:{self._port}')
+        return PandoraClient(f'localhost:{self._port}', 'android')
 
     def stop(self) -> None:
         """Stops and cleans up the Pandora server on the Android device."""
@@ -149,3 +138,4 @@
 
         self.device.adb.forward(['--remove', f'tcp:{ANDROID_SERVER_GRPC_PORT}'])  # type: ignore
         self._instrumentation.join()
+        self._instrumentation = None
diff --git a/avatar/py.typed b/avatar/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/avatar/py.typed
diff --git a/examples/asha_test.py b/examples/asha_test.py
deleted file mode 100644
index 7017ba3..0000000
--- a/examples/asha_test.py
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright 2022 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import asyncio
-import logging
-
-from avatar import BumbleDevice, PandoraDevice, PandoraDevices, asynchronous
-from bumble.gatt import GATT_ASHA_SERVICE
-from mobly import base_test, test_runner
-from mobly.asserts import assert_equal  # type: ignore
-from mobly.asserts import assert_in  # type: ignore
-from pandora.host_pb2 import DataTypes
-
-
-class ASHATest(base_test.BaseTestClass):  # type: ignore[misc]
-    ASHA_UUID = GATT_ASHA_SERVICE.to_hex_str()
-
-    dut: PandoraDevice
-    ref: BumbleDevice
-
-    def setup_class(self) -> None:
-        dut, ref = PandoraDevices(self)
-        assert isinstance(ref, BumbleDevice)
-        self.dut, self.ref = dut, ref
-
-    @asynchronous
-    async def setup_test(self) -> None:
-        async def reset(device: PandoraDevice) -> None:
-            await device.aio.host.FactoryReset()
-            device.address = (await device.aio.host.ReadLocalAddress(wait_for_ready=True)).address  # type: ignore[assignment]
-
-        await asyncio.gather(reset(self.dut), reset(self.ref))
-
-    def test_ASHA_advertising(self) -> None:
-        complete_local_name = 'Bumble'
-        protocol_version = 0x01
-        capability = 0x00
-        hisyncid = [0x01, 0x02, 0x03, 0x04, 0x5, 0x6, 0x7, 0x8]
-        truncated_hisyncid = hisyncid[:4]
-
-        self.ref.asha.Register(capability=capability, hisyncid=hisyncid)
-
-        advertisement = self.ref.host.Advertise(
-            legacy=True,
-            data=DataTypes(
-                complete_local_name=complete_local_name, incomplete_service_class_uuids16=[ASHATest.ASHA_UUID]
-            ),
-        )
-        scan = self.dut.host.Scan()
-
-        scan_result = next((x for x in scan if x.data.complete_local_name == complete_local_name))
-        logging.debug(f"scan_response.data: {scan_result}")
-
-        advertisement.cancel()
-        scan.cancel()
-
-        assert_in(ASHATest.ASHA_UUID, scan_result.data.service_data_uuid16)
-        assert_equal(type(scan_result.data.complete_local_name), str)
-        expected_advertisement_data = (
-            "{:02x}".format(protocol_version)
-            + "{:02x}".format(capability)
-            + "".join([("{:02x}".format(x)) for x in truncated_hisyncid])
-        )
-        assert_equal(expected_advertisement_data, (scan_result.data.service_data_uuid16[ASHATest.ASHA_UUID]).hex())
-
-    def test_ASHA_scan_response(self) -> None:
-        complete_local_name = 'Bumble'
-        protocol_version = 0x01
-        capability = 0x00
-        hisyncid = [0x01, 0x02, 0x03, 0x04, 0x5, 0x6, 0x7, 0x8]
-        truncated_hisyncid = hisyncid[:4]
-
-        self.ref.asha.Register(capability=capability, hisyncid=hisyncid)
-
-        advertisement = self.ref.host.Advertise(
-            legacy=True,
-            scan_response_data=DataTypes(
-                complete_local_name=complete_local_name, incomplete_service_class_uuids16=[ASHATest.ASHA_UUID]
-            ),
-        )
-        scan = self.dut.host.Scan()
-
-        scan_response = next((x for x in scan if x.data.complete_local_name == complete_local_name))
-        logging.debug(f"scan_response.data: {scan_response}")
-
-        advertisement.cancel()
-        scan.cancel()
-
-        assert_in(ASHATest.ASHA_UUID, scan_response.data.service_data_uuid16)
-        expected_advertisement_data = (
-            "{:02x}".format(protocol_version)
-            + "{:02x}".format(capability)
-            + "".join([("{:02x}".format(x)) for x in truncated_hisyncid])
-        )
-        assert_equal(expected_advertisement_data, (scan_response.data.service_data_uuid16[ASHATest.ASHA_UUID]).hex())
-
-
-if __name__ == '__main__':
-    logging.basicConfig(level=logging.DEBUG)
-    test_runner.main()  # type: ignore
diff --git a/examples/example.py b/examples/example.py
index 749bc09..b3557fc 100644
--- a/examples/example.py
+++ b/examples/example.py
@@ -13,19 +13,20 @@
 # limitations under the License.
 
 import asyncio
+import avatar
 import grpc
 import logging
 
-from avatar import BumbleDevice, PandoraDevice, PandoraDevices, asynchronous, parameterized
+from avatar import BumblePandoraDevice, PandoraDevice, PandoraDevices
 from bumble.smp import PairingDelegate
 from concurrent import futures
 from contextlib import suppress
-from mobly import base_test, test_runner
+from mobly import base_test, signals, test_runner
 from mobly.asserts import assert_equal  # type: ignore
 from mobly.asserts import assert_in  # type: ignore
 from mobly.asserts import assert_is_none  # type: ignore
 from mobly.asserts import assert_is_not_none  # type: ignore
-from mobly.asserts import fail  # type: ignore
+from mobly.asserts import explicit_pass, fail  # type: ignore
 from pandora.host_pb2 import (
     DISCOVERABLE_GENERAL,
     DISCOVERABLE_LIMITED,
@@ -45,20 +46,23 @@
 
     # pandora devices.
     dut: PandoraDevice
-    ref: BumbleDevice
+    ref: PandoraDevice
 
     def setup_class(self) -> None:
         self.devices = PandoraDevices(self)
-        dut, ref = self.devices
-        assert isinstance(ref, BumbleDevice)
-        self.dut, self.ref = dut, ref
+        self.dut, self.ref, *_ = self.devices
+
+        # Enable BR/EDR mode for Bumble devices.
+        for device in self.devices:
+            if isinstance(device, BumblePandoraDevice):
+                device.config.setdefault('classic_enabled', True)
 
     def teardown_class(self) -> None:
         if self.devices:
             self.devices.stop_all()
 
-    @asynchronous
-    async def setup_test(self) -> None:
+    @avatar.asynchronous
+    async def setup_test(self) -> None:  # pytype: disable=wrong-arg-types
         await asyncio.gather(self.dut.reset(), self.ref.reset())
 
     def test_print_addresses(self) -> None:
@@ -79,11 +83,14 @@
     # run it multiple time with different parameters.
     # Here we check that no matter the address type we use for both sides
     # the connection still complete.
-    @parameterized(
+    @avatar.parameterized(
         (RANDOM, RANDOM),
         (RANDOM, PUBLIC),
     )  # type: ignore[misc]
     def test_le_connect(self, dut_address_type: OwnAddressType, ref_address_type: OwnAddressType) -> None:
+        if not isinstance(self.ref, BumblePandoraDevice):
+            raise signals.TestSkip('Test require Bumble as reference device')
+
         advertisement = self.ref.host.Advertise(legacy=True, connectable=True, own_address_type=ref_address_type)
         scan = self.dut.host.Scan(own_address_type=dut_address_type)
         if ref_address_type == PUBLIC:
@@ -104,18 +111,21 @@
         assert dut_ref and ref_dut
         self.dut.host.Disconnect(connection=dut_ref)
 
+    @avatar.rpc_except(
+        {
+            # This test should reach the `Inquiry` timeout.
+            grpc.StatusCode.DEADLINE_EXCEEDED: lambda e: explicit_pass(e.details()),
+        }
+    )
     def test_not_discoverable(self) -> None:
         self.dut.host.SetDiscoverabilityMode(mode=NOT_DISCOVERABLE)
         inquiry = self.ref.host.Inquiry(timeout=3.0)
         try:
             assert_is_none(next((x for x in inquiry if x.address == self.dut.address), None))
-        except grpc.RpcError as e:
-            # No peers found; StartInquiry times out
-            assert_equal(e.code(), grpc.StatusCode.DEADLINE_EXCEEDED)  # type: ignore
         finally:
             inquiry.cancel()
 
-    @parameterized(
+    @avatar.parameterized(
         (DISCOVERABLE_LIMITED,),
         (DISCOVERABLE_GENERAL,),
     )  # type: ignore[misc]
@@ -127,8 +137,8 @@
         finally:
             inquiry.cancel()
 
-    @asynchronous
-    async def test_wait_connection(self) -> None:
+    @avatar.asynchronous
+    async def test_wait_connection(self) -> None:  # pytype: disable=wrong-arg-types
         dut_ref_co = self.dut.aio.host.WaitConnection(address=self.ref.address)
         ref_dut = await self.ref.aio.host.Connect(address=self.dut.address)
         dut_ref = await dut_ref_co
@@ -164,8 +174,8 @@
         try:
             while True:
                 ref_pairing_event, dut_pairing_event = await asyncio.gather(
-                    anext(ref_pairing_stream),
-                    anext(dut_pairing_stream),
+                    anext(ref_pairing_stream),  # pytype: disable=name-error
+                    anext(dut_pairing_stream),  # pytype: disable=name-error
                 )
 
                 if dut_pairing_event.method_variant() in ('numeric_comparison', 'just_works'):
@@ -205,15 +215,18 @@
             ref_pairing_stream.cancel()
             dut_pairing_stream.cancel()
 
-    @parameterized(
+    @avatar.parameterized(
         (PairingDelegate.NO_OUTPUT_NO_INPUT,),
         (PairingDelegate.KEYBOARD_INPUT_ONLY,),
         (PairingDelegate.DISPLAY_OUTPUT_ONLY,),
         (PairingDelegate.DISPLAY_OUTPUT_AND_YES_NO_INPUT,),
         (PairingDelegate.DISPLAY_OUTPUT_AND_KEYBOARD_INPUT,),
     )  # type: ignore[misc]
-    @asynchronous
-    async def test_classic_pairing(self, ref_io_capability: int) -> None:
+    @avatar.asynchronous
+    async def test_classic_pairing(self, ref_io_capability: int) -> None:  # pytype: disable=wrong-arg-types
+        if not isinstance(self.ref, BumblePandoraDevice):
+            raise signals.TestSkip('Test require Bumble as reference device(s)')
+
         # override reference device IO capability
         setattr(self.ref.device, 'io_capability', ref_io_capability)
 
@@ -246,7 +259,7 @@
             self.ref.aio.host.WaitDisconnection(connection=ref_dut),
         )
 
-    @parameterized(
+    @avatar.parameterized(
         (RANDOM, RANDOM, PairingDelegate.NO_OUTPUT_NO_INPUT),
         (RANDOM, RANDOM, PairingDelegate.KEYBOARD_INPUT_ONLY),
         (RANDOM, RANDOM, PairingDelegate.DISPLAY_OUTPUT_ONLY),
@@ -254,10 +267,13 @@
         (RANDOM, RANDOM, PairingDelegate.DISPLAY_OUTPUT_AND_KEYBOARD_INPUT),
         (RANDOM, PUBLIC, PairingDelegate.DISPLAY_OUTPUT_AND_KEYBOARD_INPUT),
     )  # type: ignore[misc]
-    @asynchronous
-    async def test_le_pairing(
+    @avatar.asynchronous
+    async def test_le_pairing(  # pytype: disable=wrong-arg-types
         self, dut_address_type: OwnAddressType, ref_address_type: OwnAddressType, ref_io_capability: int
     ) -> None:
+        if not isinstance(self.ref, BumblePandoraDevice):
+            raise signals.TestSkip('Test require Bumble as reference device(s)')
+
         # override reference device IO capability
         setattr(self.ref.device, 'io_capability', ref_io_capability)
 
@@ -269,14 +285,16 @@
         )
 
         scan = self.ref.aio.host.Scan(own_address_type=ref_address_type)
-        dut = await anext((x async for x in scan if b'pause cafe' in x.data.manufacturer_specific_data))
+        dut = await anext(
+            (x async for x in scan if b'pause cafe' in x.data.manufacturer_specific_data)
+        )  # pytype: disable=name-error
         scan.cancel()
         assert dut
 
         pairing = asyncio.create_task(self.handle_pairing_events())
         (ref_dut_res, dut_ref_res) = await asyncio.gather(
             self.ref.aio.host.ConnectLE(own_address_type=ref_address_type, **dut.address_asdict()),
-            anext(aiter(advertisement)),
+            anext(aiter(advertisement)),  # pytype: disable=name-error
         )
 
         advertisement.cancel()
diff --git a/examples/simulated_bumble_android.yml b/examples/simulated_bumble_android.yml
index 0e0f461..dca9b2c 100644
--- a/examples/simulated_bumble_android.yml
+++ b/examples/simulated_bumble_android.yml
@@ -6,4 +6,3 @@
     AndroidDevice: '*'
     BumbleDevice:
     - transport: 'tcp-client:127.0.0.1:7300'
-      classic_enabled: true
diff --git a/examples/simulated_bumble_bumble.yml b/examples/simulated_bumble_bumble.yml
index 1d79c42..a353e0a 100644
--- a/examples/simulated_bumble_bumble.yml
+++ b/examples/simulated_bumble_bumble.yml
@@ -17,12 +17,8 @@
     BumbleDevice:
     # DUT device
     - transport: 'tcp-client:127.0.0.1:6402'
-      classic_enabled: true
       class_of_device: 2360324
-      keystore: 'JsonKeyStore'
       io_capability: display_output_only
     # Reference device
     - transport: 'tcp-client:127.0.0.1:6402'
-      classic_enabled: true
       class_of_device: 2360324
-      keystore: 'JsonKeyStore'
diff --git a/pyproject.toml b/pyproject.toml
index 257985f..78acd47 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -15,7 +15,7 @@
 dev = [
     "grpcio-tools==1.51.1",
     "black==22.10.0",
-    "pyright==1.1.294",
+    "pyright==1.1.298",
     "mypy==1.0",
     "isort==5.12.0",
     "types-psutil>=5.9.5.6",
@@ -61,6 +61,11 @@
     'third-party/bumble'
 ]
 reportMissingTypeStubs = false
+reportUnknownLambdaType = false
+reportImportCycles = false
+
+[tool.pytype]
+inputs = ['avatar', 'examples']
 
 [build-system]
 requires = ["flit_core==3.7.1"]
