Add support for optional arguments to API

And add in a few tests for the optional arguments in the text tags api.