                 
                 let sem = DispatchSemaphore(value: 0)
                 
-                Alamofire.request("\(url)?\(pageKey)=\(page)", method: .get, headers: self.headers).responseJSON { response in
+                Alamofire.request(url(page), method: .get, headers: self.headers).responseJSON { response in
                     switch response.result {
                     case .success(let data):
                         print("successful")

            
            let sem = DispatchSemaphore(value: 0)
            
            Alamofire.request("\(url)?\(pageKey)=\(1)", method: .get, headers: self.headers).responseJSON { response in
                switch response.result {
                case .success(let data):
                    print("successful")

    private var url: String
    
    public init(manager: CoreDataManager, url: String, entityName: String,
                idKey: String = "id", pageKey: String = "page", pageTotalKey: String = "total_pages", perPageKey: String = "per_page", itemsPerPage: Int = 20) {
        self.url = url
        self.dataManager = manager
        self.entityName = entityName
