API for external applications (fixes #26)

for the bored people that don't want to copy all the IF statements et
cetera in their code