Updated resource library to better match the new relation API.