Add missing variables when creating ApiError exception