javascript functions can be wrapped via json()
update tests