Fix incorrect parameter names and bad SQL
Search narrowing works
Simple pagination
SELECT access to stats table