added getPosts, refactored method locations.