conditionally get/post; moved config to external file