fix test() method to properly handle HTTP methods