Fix API response when request method is GET nor POST.