Refactored checkRequestMethod and tested