a little bit of the main function work done, switched to js to refactor for a better querying model
leaving notes where i left on the backend.