add rest bindings and fix some bugs
add support for matching regular expressions