Modified API and removed a bunch of unnecessary stuff
Additional modifications. I have tested that the now implemented functionality actually works (at least in some cases).
Added necessary imports