Fixed bugs in docs and API endpoint