Add API parameters validation, fixed & simplified some APIes