add a mock middleware for test
fix dict update to integrate base_url in client creation function
fix server port as an integer
fix middleware documentation example