Add trades API call. Refactor error handling.