Add stack management

  * Function to update stack application
  * Store stack version in database
could you pout space between error: and err?