Sketch what chain api integration looks like.

This hasn't been tested.