added error middleware to api
added language setting for each client