Implementing a search and results page in the admin interface
Drupal only has only pager implementations for DB queries, but you can use the pager system manually for data in external sources. There are a couple of examples on the pager_default_initialize() docs that should get you started.
Anything other than q as the param name should work - Drupal uses q as the path param in its rewrites, so it's probably trying to find a route of foobar in your example.