check for 500s when making ajax requests