Fixing the 'get_posts' API endpoint for unauthenticated users.