Fix for Content negotiation should fallback to the first formatter that can write the type #1033

Also we should probably pass declaredType and instanceType because both together determine if an object can be written.

Related to #1081