add config and application.json
add shutdown logic