added error handling to blog post retrieval functions