Implement electerious#217. API part.

First part which modify only API. Need to continue with the JS part...