fixes problem with non 200 response from rails server