Validation

Implementation for #38
I think this doesnt belong here :)