refactored argument parsing in resource/http methods