Added a decorator for validating parameters and change the is_in_session to a decorator