rough first pass at a working API, now needs some hooks into analyze
then ES