Rewrote api calls and option parsing. The latter is not perfect,
but usable for now.