[Backend] Updated code so that it doesn't crash when sending 404.