Add app hook support
Detect server up in a more elegant way