@staticmethod
def to_json(df, x, y):
    """Format output for json response."""
    values = []
    for i, row in df.iterrows():
        values.append({'x': row[x], 'y': row[y]})
    return {'result': values}
