little api refactoring, route for  document and analysis creation