Fixes minor issue in returning an error message when the request is not POST.