Use request.params to generate a json format url when @has_json is true, not request.query_parameters. The latter has unexpected results when a querystring parameter of 'action' or 'controller' is supplied. Fixes #981.