Raise specific exception if the parameters are invalid

There are some cases where we try to parse the parameters but it fails
with ArgumentError.

1. When the parameters come from the query string and contains invalid
UTF-8 chanracters. In this case we raise ArgumentError when trying to
match the key portion of parameters with a regexp.

2. When the parameters come from the request body and the query string
contains invalid % encoded string. In this case we raise ArgumentError
when calling URI.decode_www_form_component.

Now both cases raise a InvalidParameterError what inherit from TypeError
and we can catch this exception to show a bad request for users instead
of an internal server error.