Updated these classes with exception handling
Merge pull request #2 from heshaniot/master

Updated classes with exception handling