improved error handling in Types model

implemented new get_type method with handling for
data validation errors etc