Added `validate` method

Resolved #5