Fixed bugs in internal api and payment task