Cleaned up api