api server middleware added