Integrated rest of API functionality, added unit tests