implemented simple version of all api calls.