Refactor get param in resource and demand controllers.