added http status code handling. Collections can set status code too