beginning to write api