getAllPosts requires extra function call