fix #34 and issue in API.__init__

if serializer is given as a kwarg to API.__init__, you reference the undefined local 's'