The REST API (layerindex/querysethelper.py) handles bad query parameters badly: - A filter or orderby naming an unknown field, or with the wrong number of ":" separators, raises BaseException in get_search_tuple(). Django and the WSGI server don't catch BaseException: under uWSGI the worker dies and the client gets a 502, e.g. /layerindex/api/layerItems/?filter=pn:x /layerindex/api/layerItems/?orderby=%20 The log shows: BaseException: Invalid filter ('pn', [...list of valid fields...]) - A value of the wrong type for the field raises ValueError and gives a 500, e.g. /layerindex/api/layerItems/?filter=id:abc ValueError: Field 'id' expected a number but got 'abc'. Both should be a 400 with a short message (e.g. rest_framework.exceptions.ParseError or ValidationError). Found by fuzz testing a bench instance (layers.moto-timo.io); the same requests fail on MariaDB and PostgreSQL. A fuzz pass of the API gives several hundred of these.