Changed some business logic functions to return exceptions instead where appropriate