Adding functionality for getting posts as a list