http code in case of exception must be 501