add return data for api methods
move api code in api.py file
move mail package methods in mail.py