Set resource key in serializer

This is still the bit breaking the tests.