Move exchange APIs to separate files

Signed-off-by: Pekka Enberg <penberg@iki.fi>