Convert openstreetbugs javascript to new style api