Added handling with http status codes