refactored error code and apikey to enum, added serializer and deserializer for offsetfetch