Encode/Decode id of model as uri