- check http status code first before checking json response
- back up logic altered slightly
fixed flipping logic