This is very broken. Don't use it. Functions and lambdas are not JSON-serializable.