Use is_callable insteadof method_exists.
Test query parameters and fix bugs where parameters were not set.