Allow using api.register as a decorator
Update API docs