Update API framework

Allow simpler invocation from code
Remove stupid json parameters
Use registration rather than before methods