reworked APIException, pushing some of the status_code and detail management up.  Also, makes the APIException useful in isolation (defaults to status code 500)