Updated delete method to delete relations
Added query to adapter