     
     // MARK: - Methods
     
-    public mutating func add(service: Service) -> Int {
+    public mutating func add(service: Service) -> UInt16 {
         
         let serviceAttribute = Attribute(service: service, handle: newHandle())
         

        
        attributeGroups.append(group)
        
        return attributeGroups.endIndex
    }
    
    /// Clear the database.

    }
    
    /// Remove the Service at the specified index.
    public mutating func remove(service handle: UInt16) {
        
        guard let serviceIndex = attributeGroups.index(where: { $0.service.handle == handle })
            else { fatalError("Service with handle \(handle) doesnt exist") }
        
        attributeGroups.remove(at: serviceIndex)
    }
    
    /// Write the value to attribute specified by the handle.
