updated basic API to use q promises