add tests and workarounds for invalid requests