return method not allowed for public file if method isn't get

refactor allowed method functions in router