Added api tests and apiary docs.