added status constants
implemented missing functions, cleanup