updated to include pagination, updated to have PHP examples