Re-designed the exception hierarchy.

* Seperated API exceptions from normal application exceptions.
At runtime, non-API exceptions will be convert to an API exception
then being render to response.
* Fixed serveral exceptions style. In particular, we used 'fail'
instead of 'raise' to throw an exception.
* Deleted some duplicated AERIE code.
* Minor fixes for exception logging.