added method in posts to retrieve post from server, added resolve to posts state