default error code is 500 (interal error)