API almost finished for basic purposes