use host instead of domain, prepend current protocol scheme
add upstream error handler
try and catch undef object exception
wrong branch. Revert "try and catch undef object exception"

This reverts commit c8e43a06e1a91f2c4eb76f1889b5eae7c0d1f5e7.
all /api/* paths that fail to match will return api 404 response