changes 2 endpoints to avoid confusion, changed some parameters, fix doc, add api unit tests