Updated mail API module with new DB schema and API func
Moved API modules to subfolder