Rewrite the API to be more pretty

Signed-off-by: Ondrej Kupka <ondra.cap@gmail.com>