Cleaned up response decoding with typeclass.