conversion from coffee to plain js plus addition of client side functionality via a common api