 		let url = baseURL
 			.appendingPathComponent(ReaderAPIEndpoints.itemIds.rawValue)
 			.appendingQueryItems([
-				URLQueryItem(name: "s", value: ReaderState.starred),
+				URLQueryItem(name: "s", value: ReaderState.starred.rawValue),
 				URLQueryItem(name: "n", value: "1000"),
 				URLQueryItem(name: "output", value: "json")
 			])

			return
		}
		
		let conditionalGet = accountMetadata?.conditionalGetInfo[ConditionalGetKeys.unreadEntries]
		var request = URLRequest(url: callURL, credentials: credentials, conditionalGet: conditionalGet)
		addVariantHeaders(&request)

		self.transport.send(request: request, resultType: ReaderAPIReferenceWrapper.self) { result in
			
			switch result {
			case .success(let (_, entries)):
				
				guard let entriesItemRefs = entries?.itemRefs else {
					completion(.failure(ReaderAPIAccountDelegateError.invalidResponse))
					return
				}
				
				guard entriesItemRefs.count > 0 else {
					completion(.success((nil, nil, nil)))
					return
				}
				
				self.requestAuthorizationToken(endpoint: baseURL) { (result) in
					switch result {
					case .success(let token):
						// Do POST asking for data about all the new articles
						var request = URLRequest(url: baseURL.appendingPathComponent(ReaderAPIEndpoints.contents.rawValue), credentials: self.credentials)
						self.addVariantHeaders(&request)
						request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
						request.httpMethod = "POST"
						
						// Get ids from above into hex representation of value
						let idsToFetch = entriesItemRefs.map({ (reference) -> String in
							if self.variant == .theOldReader {
								return "i=tag:google.com,2005:reader/item/\(reference.itemId)"
							} else {
								let idValue = Int(reference.itemId)!
								let idHexString = String(idValue, radix: 16, uppercase: false)
								return "i=tag:google.com,2005:reader/item/\(idHexString)"
							}
						}).joined(separator:"&")
						
						let postData = "T=\(token)&output=json&\(idsToFetch)".data(using: String.Encoding.utf8)

						self.transport.send(request: request, method: HTTPMethod.post, data: postData!, resultType: ReaderAPIEntryWrapper.self, completion: { (result) in
							switch result {
							case .success(let (response, entryWrapper)):
								guard let entryWrapper = entryWrapper else {
									completion(.failure(ReaderAPIAccountDelegateError.invalidResponse))
									return
								}
								
								let dateInfo = HTTPDateInfo(urlResponse: response)
								self.accountMetadata?.lastArticleFetchStartTime = dateInfo?.date
								self.accountMetadata?.lastArticleFetchEndTime = Date()
								
								completion(.success((entryWrapper.entries, nil, nil)))
							case .failure(let error):
								completion(.failure(error))
							}
						})
						
						
					case .failure(let error):
						completion(.failure(error))
					}

		
	}
	
}

// MARK: Private
