     private var url: String
     
     public init(manager: CoreDataManager, url: String, entityName: String,
-                idKey: String = "id", pageKey: String = "page", pageTotalKey: String = "total_pages") {
+                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

            
            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")

        
    }
    
    public func url(_ page: UInt) -> String {
        var url = "\(self.url)?\(self.pageKey)=\(page)"
        if self.usePerPage {
            url.append("&\(self.perPageKey)=\(self.perPage)")
        }
        return url
    }
    
    public func syncLoop() {
        
        do {
