added filtering code to handle custom http requests