simplify the code

- rename _get_is_valid_request_method to session_request_json
- removed useless lambda
- fix tests