Addsource jsonrpc

Took out the addsource jsonrpc from the headless addition. @Montellese to review
Or even better use an iterator