updated to handle POST/GET