refactor JsonResource
refactor JsonResource

rephrase the OPTIONS and unrecognised request handling so that they look
similar to the common flow.

matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse