start of api return functions