1. clone InputStream for logging
2. updated FactualService for testing getEntity
3. added error handling and logging for error