[api] Add guard against non-strings and zero-length strings
[api] Add guard against non-strings and zero-length strings

chrismoulton/wzrd.in,chrismoulton/wzrd.in,tsatse/browserify-cdn,jfhbrook/browserify-cdn,jfhbrook/browserify-cdn,jfhbrook/wzrd.in,rstr74/wzrd.in,wraithgar/wzrd.in,tsatse/browserify-cdn,wraithgar/wzrd.in,jfhbrook/wzrd.in,rstr74/wzrd.in