Factor out common error checking code. Add another check
Added another rest for custom parameters