Api changes

Closes #7 

@rcrichton if you could please review?
Could we rather use the full `{ }` for the if statements? I think this is better practise. The heartbleed bug shows how this sort of thing can go wrong.