use encode_json since Object-Oriented Mojo::JSON API is DEPRECATED

blame sri for the API changing.