Add API endpoint for fetching the posts