updated a bit and added the API methods