Fix serialization of hasOne and hasMany relationships for different JSON naming

Fixes #13