def post(self, request, format=None):
        '''
        creates a bucketlist for the current user
        ---
        serializer: bucketlist.serializers.BucketlistSerializer
        omit_serializer: false
        '''

        serializer = BucketlistSerializer(data=request.data)

        # create bucketlist if data is valid
        if serializer.is_valid():
            # attach the user to the bucketlist before saving
            serializer.save(created_by=request.user)
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
    def put(self, request, id, format=None):
        '''
        updates a bucketlist
        ---
        serializer: bucketlist.serializers.BucketlistSerializer
        omit_serializer: false
        '''
        # get the bucketlist
        bucketlist = self.get_object(id, request.user)
        serializer = BucketlistSerializer(bucketlist,
                                          data={'name': request.data['name']},
                                          partial=True)

        # validate serializer before saving
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_200_OK)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)