add class to encapsulate API exceptions

This class is based on the example provided here:
    http://flask.pocoo.org/docs/patterns/apierrors/

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>