defining API methods