Updated directory structure and added error codes