Update and test getPosts