Added exception handling to various parts of the API

Version API 1.0.0