added payload serializer and refactored api client