handle NOT FOUND and SERVER ERROR