ToJSON: allow custom as_json function

This allows us to modify what the API responds with, which in turn lets us unify the OpenAPI specification and the actual API's responses.

Created by  Cole Helbling  on April 28, 2021
MCTM65TRDGSWF7QDQPBXR2ALTZ4JWHTOA26Q3QLBGLKWLY47I3JAC
Change contents