added facility for general error handling with http status codes 500 and 401 #pimf #php