updated status codes and build function
latest changes