sanitize api for before/after relations

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>