Started rewriting to comply with the v1.0alpha of the api.