Updated serializer to fit dictionary format and added new tests