public async Task <IActionResult> GetPosts(string topicName) { List <Post> posts = await topicObj.GetPostsForTopicAsync(topicName); if (posts.Any()) { return(Ok(posts)); } else { return(NotFound("Posts for this topic not found")); } }