Reconfigure middleware API, add documentation