def METHOD_NAME(self, request, *args, **kwargs):
    if isinstance(request.data, list):
        stations_data = request.data
        data = {}
    else:
        data = request.data
        if 'stations' not in data:
            return Response({
                'errors': (_('stations is missing.'),),
            }, status=400)
        stations_data = data['stations']
    try:
        location = Locator.load().METHOD_NAME(stations_data, permissions=AccessPermission.get_for_request(request))
        if location is not None:
            increment_cache_key('apistats__locate__%s' % location.pk)
    except ValidationError:
        return Response({
            'errors': (_('Invalid scan data.'),),
        }, status=400)
    if 'set_position' in data and location:
        set_position = data['set_position']
        if not set_position.startswith('p:'):
            return Response({
                'errors': (_('Invalid set_position.'),),
            }, status=400)
        try:
            position = Position.objects.get(secret=set_position[2:])
        except Position.DoesNotExist:
            return Response({
                'errors': (_('Invalid set_position.'),),
            }, status=400)
        form_data = {
            **data,
            'coordinates_id': None if location is None else location.pk,
        }
        form = PositionAPIUpdateForm(instance=position, data=form_data, request=request)
        if not form.is_valid():
            return Response({
                'errors': form.errors,
            }, status=400)
        form.save()
    return Response({'location': None if location is None else location.serialize(simple_geometry=True)})