implemented config middleware
more tests for the config ware