Attempts API and its tests

Fixes #91