Use flask.json; support PORT env var.