added js functions for g-api. no proper user-interface yet.