Created locallib and started moving functions there, minor styling fixes and API URL is no longer hard-coded