Fix/serializers

Some fixes I think are necessary.

I'd like comments for anything I might have missed.

@yanick you added the code that checks the content-type. What do you think?