Api finished, but needs testing and potential bugfixing.